diff --git a/.github/workflows/on-close.yml b/.github/workflows/on-close.yml index e421da8..307b839 100644 --- a/.github/workflows/on-close.yml +++ b/.github/workflows/on-close.yml @@ -8,7 +8,7 @@ on: jobs: close-diff-viewer-pr: name: Close diff viewer PR - runs-on: ubuntu-latest + runs-on: ubuntu-slim timeout-minutes: 3 steps: - uses: Himenon/close-diff-artifact-pr@a2dbed3129e26306becce793019c1d77647fe0be diff --git a/.github/workflows/on-pull_request-build.yml b/.github/workflows/on-pull_request-build.yml index 381a43e..0f84ae3 100644 --- a/.github/workflows/on-pull_request-build.yml +++ b/.github/workflows/on-pull_request-build.yml @@ -62,7 +62,7 @@ jobs: - run: pnpm i --frozen-lockfile - name: Diff Artifacts - uses: Himenon/diff-artifact@c712f70b1020a0de2e35714c1e69d24132fc415d + uses: Himenon/diff-artifact@110f5f82e26809919a37582e8c0f5be4099524cf with: app-id: ${{ secrets.APP_ID }} app-private-key: ${{ secrets.APP_PRIVATE_KEY }} diff --git a/README.md b/README.md index d3fc16d..76d6c63 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,102 @@ const nextConfig = { export default nextConfig; ``` + +## GitHub Actions + +Diff Viewer Repo: + +### For Pull Requests: + +```yaml +name: Build and Compare Artifacts on Pull Request + +on: + pull_request: + +jobs: + build: + # ... + steps: + # some build steps + - uses: Himenon/upload-diff-artifact@01b6cc722e631f4d071c525ba6b27c9c2b2885e2 + with: + path: | + apps/nextjs14-project/.next + apps/nextjs15-project/.next + apps/nextjs16-project/.next + + diff-artifacts: + needs: build + # ... + permissions: + pull-requests: write + contents: read + actions: read + steps: + # Setup for pre-push-shell command + - name: Diff Artifacts + uses: Himenon/diff-artifact@110f5f82e26809919a37582e8c0f5be4099524cf + with: + app-id: ${{ secrets.APP_ID }} + app-private-key: ${{ secrets.APP_PRIVATE_KEY }} + diff-viewer-owner: "Himenon" + diff-viewer-repo-name: "diff-artifacts-example-diff-viewer" + gitignore-patterns: | + node_modules + cache + trace + trace-build + + # Needs Setup clone git repository, pnpm and install oxfmt + pre-push-shell: "pnpm exec oxfmt" +``` + +### After Close PR Events + +```yaml +name: "Close DIFF_VIEWER_REPO PRs on PR close" + +on: + pull_request: + types: + - closed + +jobs: + close-diff-viewer-pr: + name: Close diff viewer PR + runs-on: ubuntu-slim + timeout-minutes: 3 + steps: + - uses: Himenon/close-diff-artifact-pr@a2dbed3129e26306becce793019c1d77647fe0be + with: + app-id: ${{ secrets.APP_ID }} + app-private-key: ${{ secrets.APP_PRIVATE_KEY }} + diff-viewer-owner: Himenon + diff-viewer-repo-name: diff-artifacts-example-diff-viewer +``` + +### For Push `main(default)` Branch + +```yaml +name: Build & Push Diff Artifact + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + # some build steps ... + - uses: Himenon/upload-diff-artifact@01b6cc722e631f4d071c525ba6b27c9c2b2885e2 + with: + path: | + apps/nextjs14-project/.next + apps/nextjs15-project/.next + apps/nextjs16-project/.next +```