fix(ci): update correct logic to check for action #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy PR previews | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- closed | |
paths: | |
- 'docs/**' | |
- '.github/workflows/pr-preview.yml' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: preview-${{ github.ref }} | |
jobs: | |
deploy-preview: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./docs | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # ratchet:actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for git info | |
- uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # ratchet:actions/setup-node@v4 | |
with: | |
node-version: 22.0.0 | |
- name: Install Dependencies | |
run: npm ci | |
- name: Install and Build | |
if: github.event.action != 'closed' | |
run: npx quartz build | |
- uses: rossjrw/pr-preview-action@430e3dfc1de8a8ae77e77d862d25676ef9db55d1 # ratchet:rossjrw/pr-preview-action@v1 | |
if: github.event.action != 'closed' | |
with: | |
source-dir: ./docs/public/ | |
custom-url: tinymorph.aarnphm.xyz | |
action: deploy | |
token: ${{ github.token }} | |
- uses: rossjrw/pr-preview-action@430e3dfc1de8a8ae77e77d862d25676ef9db55d1 # ratchet:rossjrw/pr-preview-action@v1 | |
if: github.event.action == 'closed' && !github.event.pull_request.merged | |
with: | |
source-dir: ./docs/public/ | |
custom-url: tinymorph.aarnphm.xyz | |
action: remove | |
token: ${{ github.token }} |