-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (47 loc) · 1.66 KB
/
main.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
# To pin this file to a specific version of the action, run:
# npx pin-github-action main.yml
name: Build Technology Radar
on:
pull_request:
types: [ opened, synchronize, reopened, closed ]
push:
branches:
- main
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@61b9e3751b92087fd0b06925ba6dd6314e06f089 # pin@master
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # pin@v4
with:
node-version: "lts/*"
cache: "npm"
- run: npm ci
- run: PUBLIC_URL=/technology-radar npm run build:static
- run: if [ -n "$(git status --porcelain)" ]; then echo 'workspace is dirty after rebuilding' ; git status ; git diff ; exit 1 ; fi
- name: Setup Pages
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # pin@v5
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # pin@v3
with:
name: github-pages
path: build
deploy:
# runs only when pr is merged into main or when a push is done on main
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
needs: build
environment:
name: techradar
url: https://pagopa.github.io/technology-radar/index.html
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # pin@v4