Skip to content

Commit 1988877

Browse files
committed
fix: app svc image and restart
1 parent fc8065c commit 1988877

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ jobs:
3636
java-version: "17"
3737
distribution: "corretto"
3838

39+
# Az Login
40+
- name: Az Login
41+
uses: azure/login@v1
42+
with:
43+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
44+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
45+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
46+
3947
# Maven Verify
4048
- name: Maven Verify
4149
run: ./mvnw -B verify -DJAR_FILENAME=${{ env.JAR_FILENAME }}
@@ -68,18 +76,14 @@ jobs:
6876
- name: Docker Push
6977
run: docker push ghcr.io/game-as-a-service/lobby-platform-service/api:${{ github.sha }}
7078

71-
# Az Login
72-
# - name: Az Login
73-
# uses: azure/login@v1
74-
# with:
75-
# client-id: ${{ secrets.AZURE_CLIENT_ID }}
76-
# tenant-id: ${{ secrets.AZURE_TENANT_ID }}
77-
# subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
78-
79-
# Restart App Service
80-
# - name: Restart App Service
81-
# run: |
82-
# az webapp restart --name ${{ env.SYSTEMD_SERVICE_NAME }} --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }}
79+
# Set App Service Image to Latest
80+
- name: Set App Service Image to Latest
81+
env:
82+
AZURE_APPSVC_NAME: ${{ vars.AzureAppServiceName }}
83+
AZURE_RESOURCE_GROUP: ${{ vars.AzureResourceGroup }}
84+
run: |
85+
az webapp update --name ${{ env.AZURE_APPSVC_NAME }} --resource-group ${{ env.AZURE_RESOURCE_GROUP }} --set properties.image=ghcr.io/game-as-a-service/lobby-platform-service/api:${{ github.sha }}
86+
az webapp restart --name ${{ env.AZURE_APPSVC_NAME }} --resource-group ${{ env.AZURE_RESOURCE_GROUP }}
8387
8488
# Dump GitHub Context
8589
- name: Dump GitHub Context

0 commit comments

Comments
 (0)