From 3f2689872eefb93731f75b89174f0f536eafd302 Mon Sep 17 00:00:00 2001 From: Austin Dase <59173272+adase11@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:34:16 -0400 Subject: [PATCH] separate build and deploy --- .github/workflows/github-pages.yml | 31 +++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 2eca696ba..25a14c311 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -19,8 +19,7 @@ concurrency: cancel-in-progress: false jobs: - # Single deploy job since we're just deploying - deploy: + build: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} @@ -52,15 +51,37 @@ jobs: - name: Setup Pages uses: actions/configure-pages@v3 + - name: Fix permissions + run: | + chmod -v -R +rX "_site/" | while read line; do + echo "::warning title=Invalid file permissions automatically fixed::$line" + done + - name: Upload artifact id: upload - uses: actions/upload-pages-artifact@v2 + uses: actions/upload-pages-artifact@v3 with: path: "out" # Ensure 'out' is the correct directory for your static files name: github-pages # Artifact name + deploy: + # Add a dependency to the build job + needs: build + + # Grant GITHUB_TOKEN the permissions required to make a Pages deployment + permissions: + pages: write # to deploy to Pages + id-token: write # to verify the deployment originates from an appropriate source + # Deploy to the github-pages environment + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + # Specify runner + deployment step + runs-on: ubuntu-latest + steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v2 + uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action with: - artifact_name: github-pages # Ensure this matches the artifact name + name: github-pages