From e4c866c58e0ca44f1de47ad402595337b9546c8c Mon Sep 17 00:00:00 2001 From: tree Date: Fri, 24 Feb 2023 08:14:41 +0100 Subject: [PATCH] Update github actions workflow --- .github/workflows/deploy.yml | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c1724e2..1f468a1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -6,6 +6,10 @@ on: push: branches: - main + workflow_dispatch: +concurrency: + group: "pages" + cancel-in-progress: true jobs: build: runs-on: ubuntu-latest @@ -27,6 +31,11 @@ jobs: - run: find dist - uses: montudor/action-zip@v1 - run: "zip -qq -r release.zip dist" + - run: "touch dist/CNAME && echo \"${{ env.GH_PAGES_DOMAIN }}\" >> dist/CNAME" + - uses: actions/configure-pages@v3 + - uses: actions/upload-pages-artifact@v1 + with: + path: 'dist' - uses: actions/upload-artifact@v3 with: name: release @@ -61,21 +70,18 @@ jobs: prerelease: false files: | pbw-${{ env.ENTRY }}-${{ env.TAG }}.zip - pages: + deploy: needs: [build] runs-on: ubuntu-latest permissions: - contents: write + contents: read + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - - uses: actions/checkout@v3 - - uses: actions/download-artifact@v3 - with: - name: release - - uses: montudor/action-zip@v1 - - run: unzip -qq release.zip - - run: find dist - - run: "touch dist/CNAME && echo \"${{ env.GH_PAGES_DOMAIN }}\" >> dist/CNAME" - - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist \ No newline at end of file + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 + \ No newline at end of file