diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31cbd79..2c46eb4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,22 +3,20 @@ on: push: branches: - master - -permissions: - contents: read - pages: write - id-token: write + pull_request: jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: cachix/install-nix-action@v23 + - name: Checkout + uses: actions/checkout@v4 + + - uses: cachix/install-nix-action@v27 with: github_access_token: ${{ secrets.GITHUB_TOKEN }} - - uses: cachix/cachix-action@v12 + - uses: cachix/cachix-action@v15 with: name: fcitx5-android authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" @@ -27,17 +25,27 @@ jobs: run: nix develop --command mkdocs build --site-dir public - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v3 with: + name: github-pages path: public + retention-days: 90 deploy: + if: github.ref_name == 'master' + needs: build + + permissions: + pages: write + id-token: write + 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@v1 + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index 2957f60..0000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Pull Request -on: - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: cachix/install-nix-action@v23 - with: - github_access_token: ${{ secrets.GITHUB_TOKEN }} - - - uses: cachix/cachix-action@v12 - with: - name: fcitx5-android - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - - - name: Build site - run: nix develop --command mkdocs build --site-dir public - - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: public