-
Notifications
You must be signed in to change notification settings - Fork 92
59 lines (57 loc) · 1.84 KB
/
dev-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
name: Microsite Dev Deploy
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install pack
uses: jvalkeal/[email protected]
with:
pack-version: 0.24.1
- uses: actions/setup-node@v3
with:
node-version: 18.2.0
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_DEV_CREDENTIALS }}
- uses: azure/docker-login@v1
with:
login-server: ${{ secrets.AZURE_DEV_REGISTRY_URL }}
username: ${{ secrets.AZURE_DEV_REGISTRY_USERNAME }}
password: ${{ secrets.AZURE_DEV_REGISTRY_PASSWORD }}
- name: Yarn build
env:
NODE_OPTIONS: '--openssl-legacy-provider'
run: |
yarn install
yarn run fix
yarn build
- name: Prepare Paketo
run: |
cp -R public paketo/
- name: Setup Tag
run: |
echo TAG=$(date +%y%m%d%H%M%S)-${{ github.sha }} >> $GITHUB_ENV
- name: Build Image
working-directory: ./paketo
run: |
pack build ${{ secrets.AZURE_DEV_REGISTRY_URL }}/scdf-microsite-dev:$TAG \
--buildpack gcr.io/paketo-buildpacks/nginx \
--builder gcr.io/paketo-buildpacks/builder:base
docker push ${{ secrets.AZURE_DEV_REGISTRY_URL }}/scdf-microsite-dev:$TAG
- name: Deploy
uses: azure/webapps-deploy@v2
with:
app-name: scdfmicrositedev
images: ${{ secrets.AZURE_DEV_REGISTRY_URL }}/scdf-microsite-dev:${{ env.TAG }}
slot-name: green
- name: Swap green/production
uses: azure/CLI@v1
with:
inlineScript: |
az webapp deployment slot swap --resource-group scdfmicrosite-dev --name scdfmicrositedev --slot green