From a749b471091157ce9574e128458a26eab054217f Mon Sep 17 00:00:00 2001 From: Isabel Date: Tue, 26 Mar 2024 20:31:02 +0000 Subject: [PATCH] ci: add GitHub pages release step (#21) --- .github/workflows/release-deploy.yml | 68 ++++++++++++++++++++++++++++ .github/workflows/release-please.yml | 40 ---------------- 2 files changed, 68 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/release-deploy.yml delete mode 100644 .github/workflows/release-please.yml diff --git a/.github/workflows/release-deploy.yml b/.github/workflows/release-deploy.yml new file mode 100644 index 0000000..4fe41f4 --- /dev/null +++ b/.github/workflows/release-deploy.yml @@ -0,0 +1,68 @@ +name: Release and Deploy + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: denoland/setup-deno@v1 + with: + deno-version: v1.x + + - run: deno task build + + - name: Upload Pages Artifact + uses: "actions/upload-pages-artifact@v3" + with: + path: "dist/" + + release: + needs: "build" + + runs-on: ubuntu-latest + + permissions: + contents: write + pull-requests: write + + steps: + - name: "Release" + id: "release" + uses: "google-github-actions/release-please-action@v3" + with: + release-type: "simple" + + - name: Create tarball + if: ${{ steps.release.outputs.release_created }} + run: tar czf catppuccin-gitea.tar.gz --directory=./dist . + + - name: Upload Release Artifacts + if: ${{ steps.release.outputs.release_created }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload ${{ steps.release.outputs.tag_name }} ./catppuccin-gitea.tar.gz + + + deploy: + needs: "build" + + runs-on: "ubuntu-latest" + + permissions: + pages: "write" + id-token: "write" + + environment: + name: "github-pages" + url: "${{ steps.deployment.outputs.page_url }}" + + steps: + - name: "Deploy to GitHub Pages" + id: "deployment" + uses: "actions/deploy-pages@v4" diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index caad9f4..0000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,40 +0,0 @@ -on: - push: - branches: [main] - -name: release-please - -permissions: - contents: write - pull-requests: write - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: google-github-actions/release-please-action@v3 - id: release - with: - release-type: simple - - - uses: actions/checkout@v3 - if: ${{ steps.release.outputs.release_created }} - - - uses: denoland/setup-deno@v1 - if: ${{ steps.release.outputs.release_created }} - with: - deno-version: v1.x - - - run: deno task build - if: ${{ steps.release.outputs.release_created }} - - - name: Create tarball - if: ${{ steps.release.outputs.release_created }} - run: tar czf catppuccin-gitea.tar.gz --directory=./dist . - - - name: Upload Release Artifacts - if: ${{ steps.release.outputs.release_created }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: - gh release upload ${{ steps.release.outputs.tag_name }} ./catppuccin-gitea.tar.gz