Deploy website with GitHub Pages #10
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
# GitHub Pages Configuration | |
# | |
# This workflow builds the repository's website and deploys it using GitHub Pages. | |
name: Deploy website with GitHub Pages | |
on: | |
# Run on all pushes to main. | |
push: | |
branches: ['main'] | |
# Allows you to run this workflow 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 | |
# Allow one concurrent deployment | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: true | |
# We have two jobs: | |
# (1) A "build" job that's responsible for building the website using Jekyll. | |
# (2) A "deploy" job that pushes the output of the build job to GitHub Pages. | |
jobs: | |
# (1) Build job | |
build: | |
runs-on: ubuntu-latest | |
# Sequence of tasks for this job | |
steps: | |
# Check out latest code using a pre-existing GH action | |
# Docs: https://github.com/actions/checkout | |
- name: 📁 Checkout code | |
uses: actions/checkout@v2 | |
# Build the Primer Spec website. The action places the fully-built | |
# website in an `_site/` directory. | |
# Docs: https://github.com/seshrs/build-primer-spec-action | |
- name: 🛠 Build Primer Spec website | |
uses: seshrs/build-primer-spec-action@v1 | |
# Upload the _site directory created in the above step for use by | |
# GitHub Pages. | |
# Docs: https://github.com/actions/upload-pages-artifact | |
- name: 🏺 Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
# (2) Deploy job | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |