Merge pull request #298 from rackerlabs/PUC-503 #220
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: build-container-images | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths: | |
- "containers/argo_utils/**" | |
- "containers/bmc-utils/**" | |
- "containers/python311_alpine/**" | |
- "containers/python312_alpine/**" | |
push: | |
branches: | |
- main | |
paths: | |
- "containers/argo_utils/**" | |
- "containers/bmc-utils/**" | |
- "containers/python311_alpine/**" | |
- "containers/python312_alpine/**" | |
# bump container versions here, they will be populated to tags and labels | |
env: | |
VERSION_PYTHON311: 0.0.1 | |
VERSION_PYTHON312: 0.0.1 | |
VERSION_ARGO_UTILS: 0.0.1 | |
VERSION_BMC_UTILS: 0.0.1 | |
VERSION_PYTHON_NAUTOBOT: 0.0.1 | |
jobs: | |
build-ghcr-registry: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3 | |
- name: Login to ghcr.io | |
if: ${{ github.event_name != 'pull_request' }} | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3 | |
with: | |
registry: "ghcr.io" | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and deploy Python 3.11 image | |
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6 | |
with: | |
context: containers/python311_alpine/ | |
file: containers/python311_alpine/Dockerfile.python311_alpine | |
# push for all main branch commits | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ghcr.io/${{ github.repository }}/argo-python3.11.8-alpine3.19:latest,ghcr.io/${{ github.repository }}/argo-python3.11.8-alpine3.19:${{ env.VERSION_PYTHON311 }} | |
labels: | | |
org.opencontainers.image.version=${{ env.VERSION_PYTHON311 }} | |
- name: Build and deploy Python 3.12 image | |
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6 | |
with: | |
context: containers/python312_alpine/ | |
file: containers/python312_alpine/Dockerfile.python312_alpine | |
# push for all main branch commits | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ghcr.io/${{ github.repository }}/argo-python3.12.2-alpine3.19:latest,ghcr.io/${{ github.repository }}/argo-python3.12.2-alpine3.19:${{ env.VERSION_PYTHON312 }} | |
labels: | | |
org.opencontainers.image.version=${{ env.VERSION_PYTHON312 }} | |
- name: Build and deploy Argo Utils image | |
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6 | |
with: | |
context: containers/argo_utils/ | |
file: containers/argo_utils/Dockerfile.argo_utils | |
# push for all main branch commits | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ghcr.io/${{ github.repository }}/argo-utils-python3.11.8:latest,ghcr.io/${{ github.repository }}/argo-utils-python3.11.8:${{ env.VERSION_ARGO_UTILS }} | |
labels: | | |
org.opencontainers.image.version=${{ env.VERSION_ARGO_UTILS }} | |
- name: Build and deploy BMC Utils image | |
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6 | |
with: | |
context: containers/bmc-utils/ | |
file: containers/bmc-utils/Dockerfile.bmc_utils | |
# push for all main branch commits | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ghcr.io/${{ github.repository }}/argo-bmc-utils-python3.11.8:latest,ghcr.io/${{ github.repository }}/argo-bmc-utils-python3.11.8:${{ env.VERSION_BMC_UTILS }} | |
labels: | | |
org.opencontainers.image.version=${{ env.VERSION_BMC_UTILS }} |