Skip to content

Deploy static content to Pages #13

Deploy static content to Pages

Deploy static content to Pages #13

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["master"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
source_ref:
description: "Branch or tag to deploy from (default: current ref / master)"
required: false
default: ""
# 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: false
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: Determine ref to checkout
id: ref
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.source_ref }}" ]; then
echo "ref=${{ github.event.inputs.source_ref }}" >> "$GITHUB_OUTPUT"
else
# default: use the ref that triggered the workflow (master on push)
echo "ref=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ steps.ref.outputs.ref }}
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4