From b7db1dfdb37723a3eada3d97e2e0b230b536f7fc Mon Sep 17 00:00:00 2001 From: Matei Adriel Date: Sun, 29 Oct 2023 05:57:20 +0100 Subject: [PATCH] Update CI --- .github/workflows/build.yaml | 21 ++++++++++++++++++++- .github/workflows/deploy.yaml | 24 ------------------------ 2 files changed, 20 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ae047f1..5ac7910 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,9 +1,14 @@ -name: Build +name: Build and deploy on: push: pull_request: +permissions: + contents: read + pages: write + id-token: write + jobs: build: runs-on: ubuntu-latest @@ -20,3 +25,17 @@ jobs: uses: actions/upload-pages-artifact@v2 with: path: ./result/www + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + runs-on: ubuntu-latest + needs: build + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v2 diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index 462db72..0000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -1,24 +0,0 @@ -# Inspired by https://github.com/actions/starter-workflows/blob/main/pages/mdbook.yml -name: Deploy - -on: - push: - branches: [$default-branch] - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -jobs: - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2