vyxal3-release #32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |