Repository navigation
76 lines (71 loc) · 2.7 KB
/
Copy pathdeploy.yml
File metadata and controls
76 lines (71 loc) · 2.7 KB
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
name: Build and deploy
# Rebuilds on every push, and twice a day so new events appear and finished ones drop off.
on:
push:
branches: [master]
schedule:
- cron: '0 4,15 * * *'
workflow_dispatch:
# Each job asks for only what it needs. Actions are pinned to exact commits; Dependabot
# (.github/dependabot.yml) proposes updates.
permissions: {}
concurrency:
group: pages
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # saves the event data back to the repo
issues: write # keeps the events-to-review issue
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
cache: npm
- run: npm ci
# Look for York tech events from groups we don't list, and put them on the review issue.
# Nothing found this way is published until somebody ticks "Add to site" there.
- name: Discover events
continue-on-error: true
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
node scripts/discover.mjs
node scripts/candidates-issue.mjs
# Fails the run if every event source is unreachable, so the last good site stays up.
- run: npm run fetch
- name: Fetch news headlines
continue-on-error: true
run: node scripts/fetch-news.mjs
- run: npm run build
# Keep the event data in the repo: it is the site's history, and the commits stop
# GitHub from switching off this schedule after 60 days without activity.
- name: Save event data
if: github.event_name != 'push'
run: |
# ignore runs where only the "fetchedAt" time moved
if git diff --quiet -I'"fetchedAt"' -- src/data; then exit 0; fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "Update event data" -- src/data
# if master moved while we ran, the next run will save instead
git push || echo "::warning::Could not save event data this run"
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: dist
# for /.well-known/security.txt
include-hidden-files: true
deploy:
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1