generated from trywilco/Anythink-Market-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe18af5
commit b380ba6
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Container Instances | ||
# 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 --source . | ||