mirror of
https://github.com/lush2020/edgetunnel.git
synced 2026-03-22 01:22:21 +08:00
37 lines
967 B
YAML
37 lines
967 B
YAML
name: cf-worker-deploy
|
|
|
|
on:
|
|
# push:
|
|
# branches:
|
|
# - main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
environment: CF
|
|
name: Deploy
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: envsubst
|
|
run: |
|
|
envsubst < apps/cf-worker/wrangler.toml.tp > apps/cf-worker/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'
|
|
environment: ${{ env.cf_environment || 'default' }}
|
|
secrets: |
|
|
UUID
|
|
env:
|
|
UUID: ${{ secrets.UUID }}
|