(Draft) predicted/actual epiweekly plots #708
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: Create Docker Image | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
cancel-in-progress: true | |
env: | |
REGISTRY: cfaprdbatchcr.azurecr.io/ | |
IMAGE_NAME: pyrenew-hew | |
jobs: | |
build-and-push-image: | |
runs-on: cfa-cdcgov | |
name: Build and push image | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# From: https://stackoverflow.com/a/58035262/2097171 | |
- name: Extract branch name | |
run: | | |
echo "name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> \ | |
$GITHUB_OUTPUT | |
id: branch | |
- name: Figure out tag (either latest if it is main or the branch name) | |
id: image | |
run: | | |
if [ "${{ steps.branch.outputs.name }}" = "main" ]; then | |
echo "tag=latest" >> $GITHUB_OUTPUT | |
else | |
echo "tag=${{ steps.branch.outputs.name }}" >> $GITHUB_OUTPUT | |
fi | |
- name: Building and push the image | |
id: build-image | |
uses: CDCgov/cfa-actions/[email protected] | |
with: | |
container-file-1: ./Containerfile.dependencies | |
container-file-2: ./Containerfile | |
first-step-cache-key: docker-dependencies-${{ runner.os }}-${{ hashFiles('./Containerfile.dependencies') }} | |
registry: ${{ env.REGISTRY }} | |
username: cfaprdbatchcr | |
password: ${{ secrets.CFAPRDBATCHCR_REGISTRY_PASSWORD }} | |
image: ${{ env.IMAGE_NAME }} | |
build-args-2: | | |
TAG=${{ steps.image.outputs.tag }} | |
GIT_COMMIT_SHA=${{ github.event.pull_request.head.sha || github.sha }} | |
GIT_BRANCH_NAME=${{ steps.branch.outputs.name }} |