-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (64 loc) · 2.32 KB
/
azure-webapps-node-acceptance.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
71
72
name: Build and deploy Veiligstallen app to Azure Web App
on:
push:
branches:
- acceptance
paths-ignore:
- "README.md"
- ".husky"
- ".github/**"
- "**/*.csv"
- .env*
- azure/*
- github/*
- scripts/*
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
environment: acceptance
steps:
- uses: actions/checkout@v2
- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: "18.x"
- name: create env file
env:
NEXT_PUBLIC_API_BASE_URL: ${{ vars.ACC_NEXT_PUBLIC_API_BASE_URL }}
NEXT_PUBLIC_WEB_BASE_URL: ${{ vars.ACC_NEXT_PUBLIC_WEB_BASE_URL }}
DATABASE_URL: ${{vars.ACC_DATABASE_URL}}
NEXTAUTH_SECRET: ${{vars.ACC_NEXTAUTH_SECRET}}
NEXTAUTH_URL: ${{vars.ACC_NEXTAUTH_URL}}
NEXT_PUBLIC_MAPBOX_TOKEN: ${{vars.ACC_NEXT_PUBLIC_MAPBOX_TOKEN}}
run: |
touch .env
echo "NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL" >> .env
echo "NEXT_PUBLIC_WEB_BASE_URL=$NEXT_PUBLIC_WEB_BASE_URL" >> .env
echo "NODE_ENV=production >>" .env
echo "DATABASE_URL=$DATABASE_URL" >> .env
echo "NEXTAUTH_SECRET=$NEXTAUTH_SECRET" >> .env
echo "NEXTAUTH_URL=$NEXTAUTH_URL" >> .env
echo "NEXT_PUBLIC_MAPBOX_TOKEN=$NEXT_PUBLIC_MAPBOX_TOKEN" >> .env
- name: print env file
run: cat .env
- name: npm install, build, and test
env:
NEXT_PUBLIC_API_BASE_URL: ${{ vars.ACC_NEXT_PUBLIC_API_BASE_URL }}
NEXT_PUBLIC_WEB_BASE_URL: ${{ vars.ACC_NEXT_PUBLIC_WEB_BASE_URL }}
DATABASE_URL: ${{vars.ACC_DATABASE_URL}}
NEXTAUTH_SECRET: ${{vars.ACC_NEXTAUTH_SECRET}}
NEXTAUTH_URL: ${{vars.ACC_NEXTAUTH_URL}}
NEXT_PUBLIC_MAPBOX_TOKEN: ${{vars.ACC_NEXT_PUBLIC_MAPBOX_TOKEN}}
run: |
npm install
npm run build
mv ./build/static ./build/standalone/build
mv ./public ./build/standalone
- name: "Deploy to Azure Web App"
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: ${{ vars.ACC_AZURE_APP_NAME}}
publish-profile: ${{ vars.ACC_AZUREAPPSERVICE_PUBLISHPROFILE_VEILIGSTALLEN }}
package: ./build/standalone