-
Notifications
You must be signed in to change notification settings - Fork 5
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
10 changed files
with
1,767 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Deploy Worker | ||
on: | ||
push: | ||
pull_request: | ||
repository_dispatch: | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
# For Workers Deployment fork only | ||
if: github.repository != 'Gowee/zhconv-rs' | ||
timeout-minutes: 60 | ||
steps: | ||
# - run: echo '${{ toJSON(github.event) }}' | jq . | ||
- uses: actions/checkout@v2 | ||
- name: Activate OpenCC Dicts | ||
run: sed -i 's/default = \[/\0"opencc"/' worker/Cargo.toml | ||
- name: Disable other workflows in Workers fork | ||
if: github.run_number == 1 && github.event_name == 'repository_dispatch' && github.event.repository.fork == true | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
flows=$(gh workflow list --json 'name,id' --jq '.[] | select(.name != "${{ github.workflow }}") | .id') | ||
echo "Workflows to disable: $flows" | ||
for flow in $flows; do | ||
gh workflow disable $flow | ||
done | ||
# runs=$(gh run list --json 'databaseId' --jq '.[] | select(.databaseId != ${{ github.run_id }}) | .databaseId') | ||
# echo "Runs to cancel: $runs" | ||
# for run in $runs; do | ||
# gh run cancel $run | ||
# done | ||
- name: Build & Deploy Worker | ||
uses: cloudflare/wrangler-action@v3 | ||
with: | ||
apiToken: ${{ secrets.CF_API_TOKEN }} | ||
accountId: ${{ secrets.CF_ACCOUNT_ID }} | ||
workingDirectory: worker |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target | ||
node_modules | ||
.wrangler | ||
dist/ |
Oops, something went wrong.