Skip to content

Commit

Permalink
deploy2
Browse files Browse the repository at this point in the history
  • Loading branch information
darmalovan committed Aug 8, 2024
1 parent fe18af5 commit 321c549
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Deploy to Azure
on:
push:
branches:
- '**'

jobs:

build-frontend:
name: Build frontend images
runs-on: ubuntu-20.04
# needs: [check-secret]
# if: needs.check-secret.outputs.aws-creds-defined == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Log in to GHCR
id: login-ghcr
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Set the image tag
run: echo "IMAGE_NAME=$(echo ghcr.io/${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Set repository name
run: |
if [ ${{ secrets.CLUSTER_ENV }} == 'staging' ]; then
echo "REPO_NAME=staging-anythink-frontend" >> $GITHUB_ENV
else
echo "REPO_NAME=anythink-frontend" >> $GITHUB_ENV
fi
# - name: Build and push Docker image to GHCR
# uses: docker/build-push-action@v3
# with:
# context: .
# push: true
# tags: ghcr.io${{ steps.login-ecr.outputs.registry }}/${{ env.REPO_NAME }}:${{ env.IMAGE_TAG }}


# - name: Build, tag, and push frontend image to GHCR
# id: build-image-frontend
# run: |
# docker build \
# -t $IMAGE_NAME \
# -f frontend/Dockerfile.aws \
# .
# docker push $IMAGE_NAME
#
- name: Log in to Azure CLI
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Deploy to Azure
# run: |
# az container create --resource-group Universe2023CopilotRG \
# --name ${{ env.REPO_NAME }} \
# --image $IMAGE_NAME \
# --cpu 1 --memory 1 \
# --os-type Linux \
# --ports 3000 \
# --dns-name-label dartest123 \
# --registry-username vanessa-cooper \
# --registry-password ${{ secrets.GHCR_TOKEN }} \
# --command-line "yarn start"
#
# - name: Deploy to Azure Container Instances
run: |
az containerapp up -n node-calculator --ingress external --source .

0 comments on commit 321c549

Please sign in to comment.