diff --git a/.github/actions/build_test/action.yml b/.github/actions/build_test/action.yml index 0c9b7a8..4fee0ab 100644 --- a/.github/actions/build_test/action.yml +++ b/.github/actions/build_test/action.yml @@ -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 diff --git a/.github/workflows/retry_comment.yml b/.github/workflows/retry_comment.yml index e842ae3..1c75479 100644 --- a/.github/workflows/retry_comment.yml +++ b/.github/workflows/retry_comment.yml @@ -13,20 +13,26 @@ 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/request-action@v2.0.0 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: ${{ github.event.pull_request.url }} + 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 }}