Skip to content

dgibson666 is deploying the design system to Github Pages #7

dgibson666 is deploying the design system to Github Pages

dgibson666 is deploying the design system to Github Pages #7

name: Deploy Github Pages
run-name: ${{ github.actor }} is deploying the design system to Github Pages
on:
workflow_dispatch:
push:
tags:
- '*'
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
jobs:
build:
name: build static content
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
cache: npm
- run: npm ci # runs clean-install
- run: npm run build-pages # build all static sites in all packages
- name: Archive artifact
shell: sh
if: runner.os == 'Linux'
run: |
tar \
--dereference --hard-dereference \
--directory ".public" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
- uses: actions/upload-artifact@v3
with:
name: github-pages
path: ${{ runner.temp }}/artifact.tar
retention-days: "1"
if-no-files-found: error
deploy:
needs: build
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2