Skip to content

Commit

Permalink
chore: set build output dir
Browse files Browse the repository at this point in the history
  • Loading branch information
lacolaco committed Aug 23, 2024
1 parent a71cc95 commit 02a7fad
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/adev-preview-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ permissions:
# Needed in order to retrieve the artifacts from the previous job
actions: read

env:
BUILD_DIR: build/dist/bin/adev/build/browser

jobs:
deploy:
runs-on: ubuntu-latest
Expand All @@ -30,22 +33,23 @@ jobs:
uses: actions/download-artifact@v4
with:
name: adev-preview
path: ${{ env.BUILD_DIR }}
github-token: '${{secrets.GITHUB_TOKEN}}'
run-id: ${{ github.event.workflow_run.id }}
- run: ls -R
- name: Extract pull request number
id: pr-number
run: |
PR_NUMBER=$(cat __metadata__pull_number.txt)
PR_NUMBER=$(cat ./$BUILD_DIR/__metadata__pull_number.txt)
echo "value=$PR_NUMBER" >> $GITHUB_OUTPUT
- name: Extract commit hash
id: commit-hash
run: |
COMMIT_HASH=$(cat __metadata__commit_hash.txt)
COMMIT_HASH=$(cat ./$BUILD_DIR/browser__metadata__commit_hash.txt)
echo "value=$COMMIT_HASH" >> $GITHUB_OUTPUT
- run: echo ${{ steps.pr-number.outputs.value }} ${{ steps.commit-hash.outputs.value }}
- name: Deploy to cloudflare pages
run: npx wrangler pages deploy ./ --project-name $CLOUDFLARE_PAGES_PROJECT --branch pr-$PR_NUMBER --commit-hash $COMMIT_HASH
run: npx wrangler pages deploy $BUILD_DIR --project-name $CLOUDFLARE_PAGES_PROJECT --branch pr-$PR_NUMBER --commit-hash $COMMIT_HASH
env:
PR_NUMBER: ${{ steps.pr-number.outputs.value }}
COMMIT_HASH: ${{ steps.commit-hash.outputs.value }}
Expand Down

0 comments on commit 02a7fad

Please sign in to comment.