Skip to content

Commit

Permalink
Attempting to split the GH pages deploy in 2 jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
moufmouf committed Sep 25, 2024
1 parent d9d0ba1 commit 0ea5453
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions .github/workflows/gh-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ concurrency:
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -45,16 +41,35 @@ jobs:
run: cd example && npm install
- name: Build
run: npm run build && cd example && npm run build
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: ./example/dist

deploy:
if: ${{ github.event_name == 'release' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts
path: ./example/dist
- name: Setup Pages
uses: actions/configure-pages@v3
if: ${{ github.event_name == 'release' }}
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload dist repository
path: './example/dist'
if: ${{ github.event_name == 'release' }}
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
if: ${{ github.event_name == 'release' }}

0 comments on commit 0ea5453

Please sign in to comment.