cloudflare workersのtomlの設定の更新を忘れていた #2
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: update wrangler.toml | |
working-directory: ${{ matrix.root-project-path }} | |
env: | |
CLOUDFLARE_WRANGLER_TOML: ${{ secrets.CLOUDFLARE_WRANGLER_TOML }} | |
run: | | |
echo "${CLOUDFLARE_WRANGLER_TOML}" > ./wrangler.toml | |
- 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' |