From ea67eb0a21fc59dfc9b3267611c89d51af0be5c7 Mon Sep 17 00:00:00 2001 From: Hendrik Eeckhaut Date: Wed, 17 Apr 2024 23:36:16 +0200 Subject: [PATCH] Different deployement approach in GitHub workflow --- .github/workflows/yew.yml | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/.github/workflows/yew.yml b/.github/workflows/yew.yml index 6e80708..e60c1b0 100644 --- a/.github/workflows/yew.yml +++ b/.github/workflows/yew.yml @@ -10,6 +10,9 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +permissions: + contents: write + jobs: build: runs-on: ubuntu-latest @@ -38,30 +41,11 @@ jobs: run: trunk build --public-url ${{ github.event.repository.name }} --release - name: Setup Pages uses: actions/configure-pages@v5 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3.0.1 + - name: Deploy to GitHub pages + # For main branch only 🚀 + if: github.ref == 'refs/heads/main' + uses: JamesIves/github-pages-deploy-action@v4 with: - path: "./dist" - - deploy: - needs: build # Add a dependency to the build job - - # For main branch only - if: github.ref == 'refs/heads/main' - - # 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@v4.0.5 \ No newline at end of file + folder: "./dist/" + clean: true + target-folder: /