-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (44 loc) · 1.63 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
name: Deploy
on:
workflow_run:
# Runs when the workflow named “Tests” completes
workflows: [Tests]
types: [completed]
branches: [main]
permissions:
contents: read
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.event.workflow_run.head_branch }}
jobs:
deploy:
# Only runs this job when the triggering workflow run was successful (i.e. the workflow with name “Tests” succeeded).
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: balatrolator-prod
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: .nvmrc
- uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
id: node-modules-cache
with:
path: |
**/node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
- if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm clean-install
- run: npm run build
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: dist/
- uses: actions/deploy-pages@decdde0ac072f6dcbe43649d82d9c635fff5b4e4 # v4.0.4
id: deployment