-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (58 loc) · 1.75 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
71
72
73
# On pushes to `main`, deploys website to Azure, and copies data to `data` branch.
#
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions
name: deploy
on:
push:
branches: [main]
workflow_dispatch:
env:
DATABASE: testing
NODE_ENV: CI
PORT: 3002
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Cache Node.js modules
id: cache
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci --force
- name: Build app
run: npm run build
- name: Check for "only" in tests
run: npm run stop-only
- name: Run E2E tests
run: npm test
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: nisinoon
slot-name: Production
package: .
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_C789F3DAFFFF45EA89AA17889914203C }}
- name: Copy data
uses: peaceiris/actions-gh-pages@v4
with:
enable_jekyll: true
exclude_assets: '**.js,credentials.json,issues.csv'
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: data
publish_dir: data