Skip to content

feat: add build to CI #1

feat: add build to CI

feat: add build to CI #1

name: Download a parent image, build a new one, and test it; then upload the image, tags, and manifests to GitHub artifacts
env:
REGISTRY_NAME: k8scc01covidacr
DEV_REGISTRY_NAME: k8scc01covidacrdev
LOCAL_REPO: localhost:5000
HADOLINT_VERSION: "2.12.0"
on:
workflow_call:
inputs:
parent-image:
description: Parent image name
required: true
type: string
parent-variant:
description: Parent variant tag prefix
required: false
type: string
default: default
image:
description: Image name
required: true
type: string
variant:
description: Variant tag prefix
required: false
type: string
default: default
jobs:
build-test-upload:

Check failure on line 32 in .github/workflows/docker-build-test-upload.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker-build-test-upload.yaml

Invalid workflow file

You have an error in your yaml syntax on line 32
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Hadolint
run: |
sudo curl -L https://github.com/hadolint/hadolint/releases/download/v${{ env.HADOLINT_VERSION }}/hadolint-Linux-x86_64 --output hadolint
sudo chmod +x hadolint
./hadolint images/${{ inputs.image }}/Dockerfile --no-fail
- name: Echo disk usage before clean up
run: ./.github/scripts/echo_usage.sh
- name: Free up all available disk space before building
run: ./.github/scripts/cleanup_runner.sh
- name: Echo disk usage before build start
run: ./.github/scripts/echo_usage.sh
# Connect to Azure Container registry (ACR)
- uses: azure/docker-login@v1
with:
login-server: ${{ env.REGISTRY_NAME }}.azurecr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
# Connect to Azure DEV Container registry (ACR)
- uses: azure/docker-login@v1
with:
login-server: ${{ env.DEV_REGISTRY_NAME }}.azurecr.io
username: ${{ secrets.DEV_REGISTRY_USERNAME }}
password: ${{ secrets.DEV_REGISTRY_PASSWORD }}
# make build emits full_image_name, image_tag, and image_repo outputs
- name: Build image
id: build-image
run: make build/${{ input.image }} REPO=${{ env.LOCAL_REPO }}
- name: Echo disk usage after build completion
run: ./.github/scripts/echo_usage.sh