bot-make-graph #72
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: bot-make-graph | |
on: | |
workflow_dispatch: null | |
schedule: | |
- cron: '*/15 * * * *' | |
concurrency: bot-make-graph | |
jobs: | |
update-nodes: | |
name: update-nodes | |
runs-on: "ubuntu-latest" | |
strategy: | |
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
ref: ${{ steps.latest_release.outputs.tag_name }} | |
path: cf-scripts | |
- uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1 | |
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 | |
env: | |
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }} | |
- name: make graph | |
if: success() && ! env.CI_SKIP | |
run: | | |
pushd cf-graph | |
conda-forge-tick make-graph --job=${BOT_JOB} --n-jobs=3 | |
env: | |
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}" | |
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }} | |
BOT_JOB: ${{ matrix.job_num }} | |
- name: deploy | |
if: github.ref == 'refs/heads/master' && 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/master' && 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 }} | |
make-graph: | |
name: make-graph | |
needs: update-nodes | |
runs-on: "ubuntu-latest" | |
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
with: | |
ref: ${{ steps.latest_release.outputs.tag_name }} | |
path: cf-scripts | |
- uses: mamba-org/setup-micromamba@f8b8a1e23a26f60a44c853292711bacfd3eac822 # v1 | |
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 | |
env: | |
BOT_TOKEN: ${{ secrets.AUTOTICK_BOT_TOKEN }} | |
- name: make graph | |
if: success() && ! env.CI_SKIP | |
run: | | |
pushd cf-graph | |
conda-forge-tick make-graph --update-nodes-and-edges | |
env: | |
CF_TICK_GRAPH_DATA_BACKENDS: "${{ vars.CF_TICK_GRAPH_DATA_BACKENDS }}" | |
MONGODB_CONNECTION_STRING: ${{ secrets.MONGODB_CONNECTION_STRING }} | |
- name: deploy | |
if: github.ref == 'refs/heads/master' && 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: trigger next job | |
uses: benc-uk/workflow-dispatch@25b02cc069be46d637e8fe2f1e8484008e9e9609 # v1.2.3 | |
if: github.ref == 'refs/heads/master' && ! cancelled() && ! failure() && ! env.CI_SKIP | |
with: | |
workflow: bot-make-graph | |
ref: ${{ github.event.ref }} | |
token: ${{ secrets.AUTOTICK_BOT_TOKEN }} | |
- name: bump on fail | |
if: github.ref == 'refs/heads/master' && 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 }} |