diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1f21d97..6260a29 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -29,24 +29,27 @@ jobs: - name: Upload production-ready build files uses: actions/upload-artifact@v4 with: - name: production-files + name: github-pages path: ./dist deploy: name: Deploy + # Add a dependency to the build job needs: build - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' - steps: - - name: Download artifact - uses: actions/download-artifact@v4 - with: - name: production-files - path: ./dist + # 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 - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist + id: deployment + uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action