-
-
Notifications
You must be signed in to change notification settings - Fork 21
119 lines (95 loc) · 3.12 KB
/
smoketest.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Smoketest
on:
push:
pull_request:
workflow_dispatch:
env:
NODE_VERSION: 20.x
jobs:
formatting:
runs-on: ubuntu-latest
name: Verify formatting
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install dependencies
run: |
yarn install --immutable
- name: Verify formatting
run: yarn format:check
build:
name: Build site
runs-on: ubuntu-latest
needs: [formatting]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
if: github.ref == 'refs/heads/deploy' && github.event_name == 'push'
with:
static_site_generator: gatsby
- name: Install dependencies
run: |
yarn install --immutable
- name: Restore Gatsby cache
uses: actions/cache@v3
id: gatsbyCache
with:
path: ./.cache
key: ${{ runner.os }}-gatsby-cache-${{ hashFiles('public') }}
restore-keys: |
${{ runner.os }}-gatsby-cache-
- name: Build site
run: yarn build:ci
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
- name: Publish Sentry release
if: github.ref == 'refs/heads/deploy' && github.event_name == 'push'
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: davw-network
SENTRY_PROJECT: rail-announcements-web
run: |
VERSION=`yarn sentry-cli --url https://sentry.service.davw.network releases propose-version`
yarn sentry-cli --url https://sentry.service.davw.network releases new "$VERSION"
yarn sentry-cli --url https://sentry.service.davw.network releases set-commits "$VERSION" --auto
yarn sentry-cli --url https://sentry.service.davw.network releases finalize "$VERSION"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./public
# Deploy job
deploy:
# Add a dependency to the build job
needs: build
if: github.ref == 'refs/heads/deploy' && github.event_name == 'push'
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
actions: read
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3