Skip to content

Commit

Permalink
ci: wait for build before publish
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdehaven committed Jan 10, 2024
1 parent 969cb95 commit 767961b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 61 deletions.
59 changes: 0 additions & 59 deletions .github/workflows/github-pages.yaml

This file was deleted.

49 changes: 47 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ jobs:

publish:
name: Build and Publish
needs:
- run-tests
needs: [run-tests]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -49,3 +48,49 @@ jobs:
GITHUB_TOKEN: ${{ secrets.KONGPONENTS_BOT_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_PUBLIC_PUBLISH }}

deploy-github-pages:
# TODO: Change to `main` once `alpha` branch is merged
if: ${{ github.ref == 'refs/heads/alpha' }}
needs: [publish]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
timeout-minutes: 10
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: 'pages'
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PNPM with Dependencies
uses: ./.github/actions/setup-pnpm-with-dependencies/
with:
force-install: true

- name: Build Sandbox
env:
# Tell the script to use the sandbox directory
USE_SANDBOX: true
run: pnpm run build:sandbox

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload sandbox/dist directory
path: './sandbox/dist'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 767961b

Please sign in to comment.