Skip to content

Commit

Permalink
more preview fixups (#495)
Browse files Browse the repository at this point in the history
* push from build

* prod build

* typo
  • Loading branch information
adeebshihadeh authored Jun 6, 2024
1 parent c4d4ad5 commit 1c4d0c7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,22 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-pnpm

- run: pnpm install
- run: pnpm build:development
- run: pnpm build:production

- name: Upload built project
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: ./dist

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-pnpm

- run: |
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: preview

on:
pull_request_target:
types: [opened, reopened, synchronize, edited]
workflow_run:
workflows: ["build"]
types:
- completed

permissions:
contents: read
pull-requests: write

jobs:
preview:
#if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up PNPM
uses: ./.github/actions/setup-pnpm/
- uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
node-version: '16'
pnpm-version: '8'
- name: Install dependencies
run: pnpm install
- name: Build project
run: npm run build:production
name: build-artifacts
path: ./dist

# deploy
- name: Deploy to Cloudflare Pages
id: cloudflare-publish
uses: cloudflare/[email protected]
Expand All @@ -32,6 +32,7 @@ jobs:
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
directory: dist

- name: Comment URL on PR
uses: thollander/actions-comment-pull-request@v2
with:
Expand Down

0 comments on commit 1c4d0c7

Please sign in to comment.