-
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (71 loc) · 2.03 KB
/
Copy pathdeploy.yml
File metadata and controls
79 lines (71 loc) · 2.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Deploy API Project
on:
push:
branches:
- main
paths:
- "*.py"
- "requirements.txt"
- ".runtime/**"
- ".github/filters.yml"
- ".github/workflows/deploy.yml"
workflow_dispatch:
inputs:
restart_bot:
description: 'Restart API'
required: true
type: boolean
default: false
# Prevent multiple instances of this action from running at once
concurrency:
group: "deploy"
cancel-in-progress: false
queue: max
permissions:
deployments: write
contents: read
actions: write
defaults:
run:
shell: bash
jobs:
deploy:
name: Deploy Bot
uses: theantiscamgroup/workflows/.github/workflows/deploy_bot.yml@main
secrets: inherit
with:
ref: ${{ github.ref }}
path: "~/project/AntiScamBotAPI"
force_restart: ${{ github.event.inputs.restart_bot == true }}
# If we restarted the bot, we should go ahead and clear the API cache
cache_kill:
needs: deploy
if: ${{ needs.deploy.outputs.restarted == 'true' }}
name: Clear CF Cache if Restarted
uses: theantiscamgroup/workflows/.github/workflows/clear_cache.yml@main
secrets: inherit
# This will wait conditionally for the cache to be ready after the bot has been deployed
# If it hasn't been redeployed, then it will continue immediately.
wait_for_cache:
needs: deploy
runs-on: ubuntu-latest
continue-on-error: true
if: ${{ needs.deploy.outputs.restarted == 'true' }}
name: Wait
steps:
# Sleep if we were restarted
- name: Sleep
run: sleep 10
make_openapi:
name: OpenAPI
# This way we do not get stuck if the bot wasn't restarted
# So we can always have the most up to date spec
needs: wait_for_cache
if: ${{ needs.wait_for_cache.result == 'success' }}
uses: theantiscamgroup/workflows/.github/workflows/build_openapi.yml@main
secrets: inherit
with:
is_download: true
clean_deploys: true
download_uri: "https://api.scamguard.app/openapi.json"
ref: ${{ github.ref }}