Skip to content

Commit

Permalink
fix(@zakelstorm/blog): pr의 github action이 rerun되지않는 현상 수정 및 pnpm-stor…
Browse files Browse the repository at this point in the history
…e 캐시를 통한 의존성설치 시간 단축"
  • Loading branch information
nz10387 committed Jun 2, 2024
1 parent 9fc9858 commit 9811ed4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
8 changes: 8 additions & 0 deletions .github/actions/build_test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ runs:
working-directory: ./apps/blog
shell: bash

- name: Cache dependencies
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install dependencies
run: pnpm install
shell: bash
Expand Down
37 changes: 22 additions & 15 deletions .github/workflows/retry_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,27 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Checkout repository
uses: actions/checkout@v2

- name: Install GitHub CLI
run: sudo apt-get install gh

- name: Authenticate GitHub CLI
run: |
echo "${{ secrets.GIT_TOKEN }}" | gh auth login --with-token
- name: Build and Test
uses: ./.github/actions/build_test
- name: Get PR Info
id: get_pr
uses: octokit/[email protected]
with:
node-version-file: '.nvmrc'
NEXT_PUBLIC_SANITY_STUDIO_URL: ${{ secrets.NEXT_PUBLIC_SANITY_STUDIO_URL }}
NEXT_PUBLIC_BASE_URL: ${{ secrets.NEXT_PUBLIC_BASE_URL }}
NEXT_PUBLIC_SANITY_DATASET: ${{ secrets.NEXT_PUBLIC_SANITY_DATASET }}
NEXT_PUBLIC_SANITY_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_SANITY_PROJECT_ID }}
NEXT_PUBLIC_SANITY_ADMIN_TOKEN: ${{ secrets.NEXT_PUBLIC_SANITY_ADMIN_TOKEN }}
NEXT_PUBLIC_SANITY_USER_TOKEN: ${{ secrets.NEXT_PUBLIC_SANITY_USER_TOKEN }}
NEXT_PUBLIC_SANITY_REVALIDATE_SECRET: ${{ secrets.NEXT_PUBLIC_SANITY_REVALIDATE_SECRET }}
NEXT_PUBLIC_SANITY_API_VERSION: ${{ secrets.NEXT_PUBLIC_SANITY_API_VERSION }}
route: GET /repos/${{ github.repository }}/pull/${{ github.event.issue.number }}
mediaType: format=json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Set BRANCH_REF
run: echo "BRANCH_REF=$(echo ${{ steps.get_pr.outputs.data }})"

- name: Trigger build_pr workflow
run: gh workflow run build_pr.yml --ref ${{ github.event.issue.pull_request.head.sha }}

0 comments on commit 9811ed4

Please sign in to comment.