-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (64 loc) · 1.93 KB
/
generate.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
name: Generate JSON Feeds
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Set up Python 3.11
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d
with:
python-version: '3.11'
cache: 'pip'
- name: Install Dependencies
run: pip install -r requirements.txt --require-hashes --no-deps
- name: Generate Feeds
run: |
# Generate the JSON Feeds
python feed.py \
-s "${{ vars.CI_PAGES_URL }}" \
-a "${{ vars.CI_PAGES_URL }}/static/" \
-b "${{ vars.CI_PAGES_URL }}/feed" \
-g "${{ secrets.FRONT_END_REBUILD_TOKEN }}"
- name: Copy Generate Feeds
run: |
cp -R html/. static feed/
- name: Upload Feeds as Artifacts
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
with:
path: ./feed
# Deployment job
deploy:
if: (github.event_name == 'push'
&& github.ref_name == 'main') || github.event_name == 'workflow_dispatch'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e
# Trigger the front-end to rebuild
rebuild-frontend:
needs: deploy
runs-on: ubuntu-latest
steps:
- name: Build Front-End
uses: convictional/trigger-workflow-and-wait@924e4984551efec603bec665c0663332498c381a
with:
owner: codeplaysoftware
repo: sycl.tech-website
github_token: ${{ secrets.FRONT_END_REBUILD_TOKEN }}
workflow_file_name: build.yml