fix deploy workflow for main branch
All checks were successful
Deploy Pages / deploy (push) Successful in 20s
All checks were successful
Deploy Pages / deploy (push) Successful in 20s
This commit is contained in:
@ -12,9 +12,16 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- run: mkdir /tmp/deploy
|
- run: mkdir /tmp/deploy
|
||||||
- run: rsync -ua --exclude=".*" . /tmp/deploy
|
- run: rsync -ua --exclude=".*" . /tmp/deploy
|
||||||
|
- name: Set deploy branch
|
||||||
|
run: |
|
||||||
|
if [ "${{ github.ref_name }}" = "master" ]; then
|
||||||
|
echo "DEPLOY_BRANCH=main" >> "$GITHUB_ENV"
|
||||||
|
else
|
||||||
|
echo "DEPLOY_BRANCH=${{ github.ref_name }}" >> "$GITHUB_ENV"
|
||||||
|
fi
|
||||||
- name: Build & Deploy Worker
|
- name: Build & Deploy Worker
|
||||||
uses: cloudflare/wrangler-action@v3
|
uses: cloudflare/wrangler-action@v3
|
||||||
with:
|
with:
|
||||||
apiToken: ${{ secrets.CF_API_TOKEN }}
|
apiToken: ${{ secrets.CF_API_TOKEN }}
|
||||||
accountId: ${{ secrets.CF_ACCOUNT_ID }}
|
accountId: ${{ secrets.CF_ACCOUNT_ID }}
|
||||||
command: pages deploy /tmp/deploy --project-name=ctmesh-org --branch=${{ github.ref_name }}
|
command: pages deploy /tmp/deploy --project-name=ctmesh-org --branch=${{ env.DEPLOY_BRANCH }}
|
||||||
|
|||||||
Reference in New Issue
Block a user