Update _worker.js #23
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
name: Package Worker #The name of the workflow | |
on: # trigger event | |
workflow_dispatch: #Manual trigger | |
push: # Triggered when code is pushed to the repository | |
paths: # Specify the file path for the trigger condition | |
- '_worker.js' # Triggered when the _worker.js file changes | |
jobs: # Tasks in a workflow | |
package-and-commit: # mission name | |
runs-on: ubuntu-latest # Operating environment, here we use the latest version of Ubuntu | |
steps: # Task steps | |
- name: Checkout Repository # Step name, checkout code | |
uses: actions/checkout@v2 # Using the actions/checkout action | |
- name: Zip the worker file # Package the _worker.js file into worker.zip | |
run: zip worker.zip _worker.js # Use the zip command to package directly | |
- name: Commit and push the packaged file # Submit and push the packaged files | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add worker.zip | |
git commit -m "Automatically package and commit worker.zip" | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{github.repository}}.git | |
git push |