Skip to content

Deploy static content to GH Pages #4

Deploy static content to GH Pages

Deploy static content to GH Pages #4

Workflow file for this run

name: Deploy static content to GH Pages
on:
workflow_dispatch:
inputs:
destination_dir:
description: 'Version number x.x.x'
required: true
type: string
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
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:
# Deployment job
deploy:
runs-on: ubuntu-latest
steps:
- name: Ensure destination folder is not empty
if: ${{ inputs.destination_dir == '' }}
run: exit 1
- name: Checkout
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js environment
uses: actions/[email protected]
with:
cache: yarn
- name: Install dependencies
run: yarn install
- name: Build static files
env:
VITE_VERSION: ${{ inputs.destination_dir }}
run: yarn build
- name: Deploy to `${{ inputs.destination_dir }}` directory of `gh-pages` branch
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
destination_dir: ${{ inputs.destination_dir }}