Merge pull request #59 from ejjonny/fix #144
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: demo site | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
trunk: | |
name: trunk build 🌳 | |
runs-on: ubuntu-latest | |
outputs: | |
artifact-path: ${{ steps.upload_artifact.outputs.artifact-path }} | |
steps: | |
- name: Install trunk | |
uses: jetli/[email protected] | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
working-directory: "examples/demo-site" | |
run: | | |
set -euxo pipefail | |
trunk build --release --public-url https://ejjonny.github.io/backer/ | |
- name: Upload artifact | |
id: upload_artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: built-site | |
path: examples/demo-site/dist | |
deploy: | |
name: deploy 🚀 | |
needs: trunk | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: built-site | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Reupload built site | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: . | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |