linkie/.github/workflows/main.yml
2023-09-17 12:52:18 +10:00

45 lines
1,013 B
YAML

name: deploy and test
on:
repository_dispatch:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
environment: Cloudflare Worker
steps:
- uses: actions/checkout@master
- name: Publish
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
secrets: |
AUTH_KEY
env:
AUTH_KEY: ${{ secrets.AUTH_KEY }}
test:
needs: deploy
runs-on: ubuntu-latest
name: Test
environment: Cloudflare Worker
steps:
- uses: actions/checkout@master
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Test
env:
DEPLOY_HOST: ${{ vars.DEPLOY_HOST }}
AUTH_KEY: ${{ secrets.AUTH_KEY }}
run:
python test.py