-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLDR-17803 docs/site: fix merge to main
- only update PR if there's a PR - Merge to main should update the production deployment
- Loading branch information
Showing
1 changed file
with
13 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -39,15 +39,27 @@ jobs: | |
- name: Pre-install Wrangler | ||
run: npm i -g [email protected] | ||
# see https://github.com/cloudflare/wrangler-action/issues/286 | ||
- name: Set the environment | ||
id: chooser | ||
run: | | ||
echo ${{ github.event_name }} ${{ github.ref }} ; | ||
if [[ "${{ github.event_name }}" == 'push' && "${{ github.ref }}" == 'refs/heads/main' ]]; then | ||
echo cenv=production >> $GITHUB_OUTPUT | ||
echo prod | ||
else | ||
echo cenv=preview >> $GITHUB_OUTPUT | ||
echo preview | ||
fi | ||
- name: Deploy cldr.pages.dev | ||
id: deploy | ||
uses: cloudflare/wrangler-action@v3 | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
command: pages deploy ./_site --project-name=cldr | ||
command: pages deploy ./_site --project-name=cldr --branch ${{ steps.chooser.outputs.cenv }} | ||
- name: Add deploy comment to PR | ||
uses: actions/github-script@v7 | ||
if: github.event_name == 'pull_request' | ||
with: | ||
script: | | ||
github.rest.issues.createComment({ | ||
|