generated from trywilco/Anythink-Market-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (61 loc) · 2.17 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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 .