Skip to content

actions: harden ci (#342) #302

actions: harden ci (#342)

actions: harden ci (#342) #302

Workflow file for this run

name: Deploy Worker
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy:
name: Deploy Cloudflare Worker
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858
with:
egress-policy: audit
- name: Git Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm'
- name: Install Dependencies
run: npm install
- name: Deploy to Staging
if: github.event_name == 'push'
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: deploy --env staging
- name: Deploy to Production
if: github.event_name == 'workflow_dispatch'
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: deploy --env prod