-
Notifications
You must be signed in to change notification settings - Fork 79
176 lines (152 loc) · 5.55 KB
/
bot-update-nodes.yml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: bot-update-nodes
on:
workflow_dispatch: null
schedule:
- cron: '15 * * * *'
concurrency: bot-update-nodes
jobs:
update-nodes:
name: update-nodes
runs-on: "ubuntu-latest"
env:
NUM_BOT_JOBS: 3
strategy:
fail-fast: false
matrix:
job_num: [ 1, 2, 3 ]
defaults:
run:
shell: bash -leo pipefail {0}
steps:
- name: get latest release
id: latest_release
run: |
tag_name=$(gh api repos/regro/cf-scripts/releases/latest --jq '.tag_name')
echo "latest release: ${tag_name}"
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ steps.latest_release.outputs.tag_name }}
path: cf-scripts
- uses: mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc # v2.0.4
with:
environment-file: cf-scripts/conda-lock.yml
environment-name: cf-scripts
condarc-file: cf-scripts/autotick-bot/condarc
- name: do local setup and stop me if needed
run: |
cd cf-scripts
python autotick-bot/stop_me_if_needed.py
- name: install bot code
if: success() && ! env.CI_SKIP
run: |
source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
- name: update nodes
if: success() && ! env.CI_SKIP
run: |
pushd cf-graph
export RUN_URL="https://github.com/regro/cf-scripts/actions/runs/${RUN_ID}"
conda-forge-tick make-graph \
--job=${BOT_JOB} \
--n-jobs=${NUM_BOT_JOBS}
env:
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}"
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }}
BOT_JOB: ${{ matrix.job_num }}
RUN_ID: ${{ github.run_id }}
- name: deploy
if: github.ref == 'refs/heads/main' && always() && ! env.CI_SKIP
run: |
pushd cf-graph
export RUN_URL="https://github.com/regro/cf-scripts/actions/runs/${RUN_ID}"
conda-forge-tick deploy-to-github
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
RUN_ID: ${{ github.run_id }}
- name: bump on fail
if: github.ref == 'refs/heads/main' && failure() && ! env.CI_SKIP
run: |
export ACTION_URL="https://github.com/regro/cf-scripts/actions/runs/${RUN_ID}"
python cf-scripts/autotick-bot/bump_bot_team.py
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
RUN_ID: ${{ github.run_id }}
ACTION_NAME: ${{ github.workflow }}
migrate-schema:
name: migrate-schema
needs:
- update-nodes
runs-on: "ubuntu-latest"
env:
NUM_BOT_JOBS: 3
strategy:
fail-fast: false
matrix:
job_num: [ 1, 2, 3 ]
defaults:
run:
shell: bash -leo pipefail {0}
steps:
- name: get latest release
id: latest_release
run: |
tag_name=$(gh api repos/regro/cf-scripts/releases/latest --jq '.tag_name')
echo "latest release: ${tag_name}"
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ steps.latest_release.outputs.tag_name }}
path: cf-scripts
- uses: mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc # v2.0.4
with:
environment-file: cf-scripts/conda-lock.yml
environment-name: cf-scripts
condarc-file: cf-scripts/autotick-bot/condarc
- name: do local setup and stop me if needed
run: |
cd cf-scripts
python autotick-bot/stop_me_if_needed.py
- name: install bot code
if: success() && ! env.CI_SKIP
run: |
source cf-scripts/autotick-bot/install_bot_code.sh --no-clean-disk-space
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
- name: update nodes
if: success() && ! env.CI_SKIP
run: |
pushd cf-graph
export RUN_URL="https://github.com/regro/cf-scripts/actions/runs/${RUN_ID}"
conda-forge-tick make-graph \
--job=${BOT_JOB} \
--n-jobs=${NUM_BOT_JOBS} \
--schema-migration-only
env:
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}"
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }}
BOT_JOB: ${{ matrix.job_num }}
RUN_ID: ${{ github.run_id }}
- name: deploy
if: github.ref == 'refs/heads/main' && always() && ! env.CI_SKIP
run: |
pushd cf-graph
export RUN_URL="https://github.com/regro/cf-scripts/actions/runs/${RUN_ID}"
conda-forge-tick deploy-to-github
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
RUN_ID: ${{ github.run_id }}
- name: bump on fail
if: github.ref == 'refs/heads/main' && failure() && ! env.CI_SKIP
run: |
export ACTION_URL="https://github.com/regro/cf-scripts/actions/runs/${RUN_ID}"
python cf-scripts/autotick-bot/bump_bot_team.py
env:
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }}
RUN_ID: ${{ github.run_id }}
ACTION_NAME: ${{ github.workflow }}