-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
8 additions
and
28 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,16 +16,6 @@ jobs: | |
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Big Eye-catching Banner | ||
run: | | ||
echo "::warning::" | ||
echo "******************************************************************************" | ||
echo "* *" | ||
echo "* 🚀 Running Preview Workflow boiiiiii 🚀 *" | ||
echo "* *" | ||
echo "******************************************************************************" | ||
echo "::end::" | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download build artifacts | ||
|
@@ -36,22 +26,9 @@ jobs: | |
run-id: ${{ github.event.workflow_run.id }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: List dist directory contents | ||
run: ls -R ./dist | ||
|
||
- name: Check if AccountMenu.jsx exists | ||
run: | | ||
if [ ! -f ./dist/src/components/AppHeader/AccountMenu.jsx ]; then | ||
echo "::error:: AccountMenu.jsx not found!" | ||
exit 1 | ||
fi | ||
- name: Get Git Commit Hash | ||
id: commit_hash | ||
run: echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV | ||
|
||
- name: Inject Git Commit Hash | ||
run: sed -i "s/REACT_APP_GIT_COMMIT_HASH_PLACEHOLDER/${{ env.COMMIT_HASH }}/g" ./dist/src/components/AppHeader/AccountMenu.jsx | ||
run: echo "::set-output name=commit_hash::$(git rev-parse HEAD)" | ||
|
||
- name: Find PR number | ||
id: pr | ||
|
@@ -71,14 +48,17 @@ jobs: | |
console.info("Pull request number is", pullRequestNumber) | ||
return pullRequestNumber | ||
- name: Build Project | ||
run: npm run build | ||
- name: Inject Git Commit Hash | ||
run: sed -i "s/REACT_APP_GIT_COMMIT_HASH/${{ steps.commit_hash.outputs.commit_hash }}/g" ./src/components/AppHeader/AccountMenu.jsx | ||
|
||
- name: Set React Environment Variable | ||
run: echo "REACT_APP_GIT_COMMIT_HASH=${{ steps.commit_hash.outputs.commit_hash }}" >> $GITHUB_ENV | ||
fix | ||
- name: Deploy to Cloudflare Pages | ||
id: cloudflare-publish | ||
uses: cloudflare/[email protected] | ||
with: | ||
branch: ${{ github.head_ref }} | ||
branch: ${{ steps.pr.outputs.result }} | ||
projectName: connect | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} | ||
|
@@ -94,7 +74,7 @@ jobs: | |
* mark your PR as a draft until it's ready to review | ||
* post the preview on [Discord](https://discord.comma.ai); feedback from users will speed up the PR review | ||
Deployed preview: https://${{ steps.pr.outputs.result }}.connect-d5y.pages.dev (Commit: ${{ env.COMMIT_HASH }}) | ||
Deployed preview: https://${{ steps.pr.outputs.result }}.connect-d5y.pages.dev (Commit: ${{ steps.commit_hash.outputs.commit_hash }}) | ||
comment_tag: run_id | ||
pr_number: ${{ steps.pr.outputs.result }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |