-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (61 loc) · 2.46 KB
/
on-release.yaml
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
name: Create release from tag
on:
repository_dispatch:
types: [vyxal3-release]
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
id-token: write
pages: write
# Allow one concurrent deployment
concurrency:
group: "release"
cancel-in-progress: true
jobs:
# This goes in the website
release:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Create release directory & clone vyxal.github.io into it
run: |
python -m pip install --upgrade pip
python -m pip install requests
mkdir ${{github.event.client_payload.tag}}
git clone https://github.com/Vyxal/vyxal.github.io.git ${{github.event.client_payload.tag}}
cd ${{github.event.client_payload.tag}}
rm -rfd .git
- name: Delete landing page version of index.html
run: cd ${{github.event.client_payload.tag}}; rm index.html
- name: Rename latest.html to index.html
run: mv ${{github.event.client_payload.tag}}/latest.html ${{github.event.client_payload.tag}}/index.html
- name: Overwrite worker.js
run: python helpers/create_worker.py ${{github.event.client_payload.tag}}
- name: Update versions.json
run: python helpers/update_versions_files.py ${{github.event.client_payload.tag}}
- name: Download external js from dispatch
run: python helpers/download_files.py ${{toJSON(github.event.client_payload.files)}} ${{github.event.client_payload.tag}}
- name: Download parsed_yaml.js from vyxal.github.io/pages/parsed_yaml.js
run: |
curl https://vyxal.github.io/Vyxal/parsed_yaml.js >> parsed_yaml.js
mv parsed_yaml.js ${{github.event.client_payload.tag}}
- name: Finally, replace the imports in the files
run: |
cd ${{github.event.client_payload.tag}}
python ../helpers/overwrite_imports.py
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Push new version files.
- name: Upload built HTML
uses: actions/upload-pages-artifact@v1
with:
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1