cloudflare workersのGithub Actionsのtemplateを作成 #1
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
on: | |
push: | |
branches: | |
- cloudflare-workers-deploy | |
name: Deploy Cloudflare Workers | |
jobs: | |
builddeploy: | |
name: Deploy Cloudflare Workers | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
root-project-path: [./cloudflare-workers] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup ubuntu | |
run: | | |
sudo apt-get --quiet update --yes | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: yarn install | |
working-directory: ${{ matrix.root-project-path }} | |
run: yarn install | |
- name: deploy to cloudflare workers | |
uses: cloudflare/wrangler-action@v3 | |
with: | |
workingDirectory: ${{ matrix.root-project-path }} | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
secrets: | | |
SAMPLE_SECRET_API_KEY | |
env: | |
SAMPLE_SECRET_API_KEY: 'SAMPLE' |