Release Demo #133
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: Release Demo | |
# Job will only run on push to the main branch after the test job and release library job have passed | |
on: | |
workflow_run: | |
workflows: [ "Release Library" ] | |
types: [ completed ] | |
workflow_dispatch: | |
inputs: { } | |
permissions: | |
# contents: write # Required to publish to GitHub Pages branch | |
# packages: write # Required to publish to GitHub Pages branch | |
id-token: write # Required to publish to GitHub Pages | |
pages: write # Required to publish to GitHub Pages | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: false | |
env: | |
ARTIFACT_NAME: "build-demo-artifact" | |
jobs: | |
build: | |
if: | | |
github.ref == 'refs/heads/main' && | |
github.event.repository.fork == false && | |
github.actor != 'dependabot[bot]' | |
runs-on: ubuntu-latest | |
timeout-minutes: 2 | |
environment: github-pages | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Bun - Version ${{ vars.BUN_VERSION }} | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: ${{ vars.BUN_VERSION }} | |
- name: Install dependencies | |
run: bun install | |
- name: Build demo | |
run: | | |
bun run gh-pages:build | |
bun run gh-pages:copy404 | |
bun run gh-pages:postBuild | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: ${{ vars.DEMO_PATH }} | |
if-no-files-found: error | |
release: | |
if: | | |
github.ref == 'refs/heads/main' && | |
github.event.repository.fork == false && | |
github.actor != 'dependabot[bot]' | |
runs-on: ubuntu-latest | |
timeout-minutes: 2 | |
environment: github-pages | |
needs: [ build ] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.ARTIFACT_NAME }} | |
path: ${{ vars.DEMO_PATH }} | |
# - name: Deploy to gh-pages branch | |
# uses: peaceiris/actions-gh-pages@v4 | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# publish_dir: ${{ vars.DEMO_PATH }} | |
# publish_branch: gh-pages | |
# force_orphan: true | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- name: Upload artifact to Pages | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ${{ vars.DEMO_PATH }} | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |