Deploy to Production #102
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: Deploy to Production | |
on: | |
push: | |
branches: | |
- main | |
# schedule: # Run workflow automatically | |
# - cron: '0 1 * * *' # Runs every day at 1:00 AM (min hour day month) | |
workflow_dispatch: # Run workflow manually (without waiting for the cron to be called), through the Github Actions Workflow page directly | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install and Build components 🔧 | |
# .nojekyll: do not ignore _ dirs | |
run: | | |
npm ci | |
npm run build | |
touch build/.nojekyll | |
# CI: false # true -> fails on warning | |
- name: Download versions from 2023 | |
uses: robinraju/release-downloader@v1 | |
with: | |
tag: '2023' | |
fileName: 'dist.tar.gz' | |
- name: Extract versions from 2023 | |
run: | | |
mkdir -p build/2023 | |
tar -xvf dist.tar.gz --directory build/2023 | |
- name: Download versions from 2024 | |
uses: robinraju/release-downloader@v1 | |
with: | |
tag: '2024' | |
fileName: 'dist.tar.gz' | |
- name: Extract versions from 2024 | |
run: | | |
mkdir -p build/2024 | |
tar -xvf dist.tar.gz --directory build/2024 | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload build repository | |
path: 'build' | |
- name: Deploy to GitHub Pages 🚀 | |
id: deployment | |
uses: actions/deploy-pages@v4 |