Files
edgetunnel/.github/workflows/cf-worker-deploy.yml
zizifn 72567f8cbf add cf worker hello world project and enable deploy via GITHUB action (#78)
add cf worker hello world project and enable deploy via GITHUB action
2022-12-18 01:33:12 +08:00

38 lines
995 B
YAML

name: cf-worker-deploy
on:
push:
branches:
- main
- test-cf
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
environment: CF
name: Deploy
steps:
- uses: actions/checkout@v2
- name: envsubst
run: |
envsubst < apps/cf-worker-vless/wrangler.toml.tp > apps/cf-worker-vless/wrangler.toml
if [[ $CUSTOM_DOMAIN ]]; then
echo cf_environment="custom" >> $GITHUB_ENV
else
echo "not set CUSTOM_DOMAIN"
fi
env:
CUSTOM_DOMAIN: ${{ secrets.CUSTOM_DOMAIN }}
- name: Publish
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: publish --env ${{ env.cf_environment || 'default' }}
workingDirectory: 'apps/cf-worker-vless'
environment: ${{ env.cf_environment || 'default' }}
secrets: |
UUID
env:
UUID: ${{ secrets.UUID }}