From 381b615001681eb014ca4ced6b21abcbf9d294bd Mon Sep 17 00:00:00 2001 From: jyje Date: Sun, 18 Feb 2024 22:11:39 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20.github/workflows/:=20move=20workfl?= =?UTF-8?q?ows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yaml | 60 +++++++++++++++++++++++++++++++ .github/workflows/utterances.yaml | 12 +++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/deploy.yaml create mode 100644 .github/workflows/utterances.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 000000000..86161766f --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,60 @@ +name: Deploy Quartz site to GitHub Pages + +on: + pull_request: + branches: + - main + push: + branches: + - main + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for git info + - uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Install Dependencies + run: npm ci + - name: Build Quartz + run: npx quartz build + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: public + + deploy: + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + if: github.actor == 'jyje' + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + + auto-approve: + needs: build + runs-on: ubuntu-latest + permissions: + pull-requests: write + if: github.actor == 'dependabot[bot]' + steps: + - uses: hmarr/auto-approve-action@v4 + with: + review-message: "Auto approved automated PR" diff --git a/.github/workflows/utterances.yaml b/.github/workflows/utterances.yaml new file mode 100644 index 000000000..f5b54f9ee --- /dev/null +++ b/.github/workflows/utterances.yaml @@ -0,0 +1,12 @@ +name: Control utterances issue +on: + issues: + types: [opened] +jobs: + close-issue: + runs-on: ubuntu-latest + steps: + - name: Close Issue + if: github.event.issue.user.login == 'utterances-bot' + uses: peter-evans/close-issue@v3 +