Skip to content

Commit bf20b6c

Browse files
scheduling make run-prod, using caj by default, rm unused wf (#343)
* scheduling make run-prod, using caj by default, rm unused wf * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent acc3592 commit bf20b6c

4 files changed

Lines changed: 71 additions & 59 deletions

File tree

.github/workflows/run-prod.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: make run-prod (or custom)
2+
3+
on:
4+
schedule:
5+
- cron: '0 13 * * 3'
6+
workflow_dispatch:
7+
inputs:
8+
command:
9+
description: The Makefile command to run. Default = make run-prod
10+
type: string
11+
12+
env:
13+
COMMAND: ${{ inputs.command || 'make run-prod' }}
14+
15+
jobs:
16+
run-command:
17+
permissions:
18+
id-token: write # This is required for requesting the JWT
19+
contents: read # This is required for actions/checkout
20+
environment: production
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Checkout Repo
25+
id: checkout_repo
26+
uses: actions/checkout@v4
27+
28+
# From: https://stackoverflow.com/a/58035262/2097171
29+
- name: Extract branch name
30+
shell: bash
31+
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
32+
id: get-branch
33+
34+
# From: https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-cloud-providers#requesting-the-jwt-using-the-actions-core-toolkit
35+
- name: Install OIDC Client from Core Package
36+
run: npm install @actions/core@1.6.0 @actions/http-client
37+
- name: Get Id Token
38+
uses: actions/github-script@v7
39+
id: idtoken
40+
with:
41+
script: |
42+
const coredemo = require('@actions/core')
43+
const id_token = await coredemo.getIDToken('api://AzureADTokenExchange')
44+
coredemo.setOutput('id_token', id_token)
45+
46+
47+
- name: Run command
48+
uses: CDCgov/cfa-actions/runner-action@v1.4.0
49+
with:
50+
github_app_id: ${{ secrets.CDCENT_ACTOR_APP_ID }}
51+
github_app_pem: ${{ secrets.CDCENT_ACTOR_APP_PEM }}
52+
wait_for_completion: true
53+
print_logs: true
54+
script: |
55+
echo "Logging into Azure CLI"
56+
az login --service-principal \
57+
--username ${{ secrets.AZURE_NNHT_SP_CLIENT_ID }} \
58+
--tenant ${{ secrets.TENANT_ID }} \
59+
--federated-token ${{ steps.idtoken.outputs.id_token }} \
60+
--output none
61+
62+
CURRENT_BRANCH="${{ steps.get-branch.outputs.branch }}"
63+
echo "Cloning repo at branch '$CURRENT_BRANCH'"
64+
git clone -b "$CURRENT_BRANCH" https://github.com/${{ github.repository }}.git
65+
cd cfa-epinow2-pipeline
66+
67+
echo 'Running command: "${{ env.COMMAND }}"'
68+
${{ env.COMMAND }}

.github/workflows/start-app-job.yaml

Lines changed: 0 additions & 57 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ run-batch: ## Runs job.py on Azure Batch
6161
--pool_id="$(POOL)" \
6262
--job_id="$(JOB)"
6363

64-
run-prod: config run-batch ## Calls config and run-batch
64+
run-prod: config run-caj ## Calls config and run-caj
6565

66-
rerun-prod: rerun-config run-batch ## Calls rerun-config and run-batch
66+
rerun-prod: rerun-config run-caj ## Calls rerun-config and run-caj
6767

6868
run: ## Run pipeline from R interactively in the container
6969
$(CNTR_MGR) run --mount type=bind,source=$(PWD),target=/mnt -it \

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CFAEpiNow2Pipeline v0.2.0
22

33
## Features
4+
* Scheduling `make run-prod` on Github Actions Wednesdays at 8 AM ET
45
* Adds facility active proportion information for config runs and re-runs
56
* Adds RSV into the makefile for configs
67
* Updating EpiNow2 from version 1.4.1.9000 to version 1.6.1

0 commit comments

Comments
 (0)