Build and Deploy Pages #3
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: Build and Deploy Pages | |
on: | |
push: | |
tags: | |
- 'v**' | |
# Allow running manually from the actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
# Single deploy job since we're just deploying | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: Set Deployed Flag | |
run: | | |
bash ./.github/set-deployed-flag.sh ${{ github.ref_name }} | |
# Remove entries from the `.gitignore` so the gh-pages action can correctly add+commit them to the pages branch | |
- name: Build Service Worker | |
run: | | |
node --version | |
npm --version | |
npm i | |
npm run build:sw:prod | |
sed -i 's/sw.js//g' .gitignore | |
sed -i 's/sw-injector.js//g' .gitignore | |
- name: Build SEO Pages | |
env: | |
VET_SEO_IS_DEV_MODE: true | |
VET_BASE_SITE_URL: https://5etools-mirror-1.github.io/ | |
VET_SEO_IS_SKIP_UA_ETC: true | |
run: | | |
npm run build:seo -- ${{ github.ref_name }} | |
- name: Cleanup | |
run: | | |
rm -rf node_modules | |
- name: Setup Pages | |
uses: actions/configure-pages@master | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@master | |
with: | |
path: '.' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@master | |
with: | |
# Timeout in millis (1 hour) | |
timeout: 3600000 |