Skip to content

Commit 227176d

Browse files
authored
Update deploy-staging.yml
1 parent 3cea0cc commit 227176d

File tree

1 file changed

+58
-1
lines changed

1 file changed

+58
-1
lines changed

.github/workflows/deploy-staging.yml

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,63 @@ env:
1717

1818
jobs:
1919
build:
20+
if: contains(github.event.pull_request.labels.*.name, 'stage')
21+
2022
runs-on: ubuntu-latest
2123

22-
if: contains(github.event.pull_request.labels.*.name, 'stage')
24+
steps:
25+
- uses: actions/checkout@v1
26+
- name: npm install and build webpack
27+
run: |
28+
npm install
29+
npm run build
30+
- uses: actions/upload-artifact@master
31+
with:
32+
name: webpack artifacts
33+
path: public/
34+
35+
Build-Docker-Image:
36+
runs-on: ubuntu-latest
37+
needs: build
38+
name: Build image and store in GitHub Packages
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v1
42+
43+
- name: Download built artifact
44+
uses: actions/download-artifact@master
45+
with:
46+
name: webpack artifacts
47+
path: public
48+
49+
- name: create image and store in Packages
50+
uses: mattdavis0351/actions/[email protected]
51+
with:
52+
repo-token: ${{secrets.GITHUB_TOKEN}}
53+
image-name: ${{env.DOCKER_IMAGE_NAME}}
54+
55+
Deploy-to-Azure:
56+
runs-on: ubuntu-latest
57+
needs: Build-Docker-Image
58+
name: Deploy app container to Azure
59+
steps:
60+
- name: "Login via Azure CLI"
61+
uses: azure/login@v1
62+
with:
63+
creds: ${{ secrets.AZURE_CREDENTIALS }}
64+
65+
- uses: azure/docker-login@v1
66+
with:
67+
login-server: ${{env.IMAGE_REGISTRY_URL}}
68+
username: ${{ github.actor }}
69+
password: ${{ secrets.GITHUB_TOKEN }}
70+
71+
- name: Deploy web app container
72+
uses: azure/webapps-deploy@v2
73+
with:
74+
app-name: ${{env.AZURE_WEBAPP_NAME}}
75+
images: ${{env.IMAGE_REGISTRY_URL}}/${{ github.repository }}/${{env.DOCKER_IMAGE_NAME}}:${{ github.sha }}
76+
77+
- name: Azure logout
78+
run: |
79+
az logout

0 commit comments

Comments
 (0)