Deploy and build site #15
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 and build site | |
on: | |
workflow_dispatch: | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Git | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | |
- name: Setup Node | |
uses: actions/setup-node@26961cf329f22f6837d5f54c3efd76b480300ace # v4 | |
with: | |
node-version: '20.x' | |
- name: Build | |
run: node build/index.js | |
- name: List Site (build) | |
run: echo Site files && echo | ls ./site | |
- name: Write Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-output | |
path: ./site | |
deploy: | |
needs: build | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-output | |
path: ./site | |
- name: List Site (deploy) | |
run: echo Site files && echo | ls ./site | |
- name: Upload Artifact | |
uses: actions/[email protected] | |
with: | |
path: ./site | |
retention-days: 0.05 | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3 | |
with: | |
publish_dir: ./site | |
github_token: ${{ github.token }} | |
full_commit_message: 'Build' |