linkie/.github/workflows/main.yml

45 lines
1,013 B
YAML
Raw Permalink Normal View History

2023-09-16 17:39:43 -04:00
name: deploy and test
2023-09-16 17:38:21 -04:00
on:
repository_dispatch:
push:
branches:
- main
jobs:
deploy:
2023-09-16 17:19:04 -04:00
runs-on: ubuntu-latest
name: Deploy
2023-09-16 16:44:48 -04:00
environment: Cloudflare Worker
steps:
- uses: actions/checkout@master
- name: Publish
2023-09-16 16:38:07 -04:00
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
secrets: |
AUTH_KEY
env:
AUTH_KEY: ${{ secrets.AUTH_KEY }}
2023-09-16 17:19:04 -04:00
test:
2023-09-16 17:25:10 -04:00
needs: deploy
2023-09-16 17:19:04 -04:00
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:
2023-09-16 22:52:18 -04:00
DEPLOY_HOST: ${{ vars.DEPLOY_HOST }}
2023-09-16 17:19:04 -04:00
AUTH_KEY: ${{ secrets.AUTH_KEY }}
run:
python test.py