Skip to content

Commit

Permalink
CLDR-17803 docs/site: fix merge to main
Browse files Browse the repository at this point in the history
- only update PR if there's a PR
- Merge to main should update the production deployment
  • Loading branch information
srl295 committed Aug 28, 2024
1 parent 3340398 commit 2029b2f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down

0 comments on commit 2029b2f

Please sign in to comment.