Create action to manage tests container (#1312) #1
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
# Build and push a container to ghcr.io | |
name: 'Update Container' | |
on: | |
push: | |
branches: | |
- 'master' | |
paths: | |
- 'Container/**' | |
pull_request: | |
branches: | |
- 'master' | |
paths: | |
- 'Container/**' | |
workflow_dispatch: | |
env: | |
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} | |
jobs: | |
build: | |
name: Build the container | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Log in to the Container registry | |
uses: redhat-actions/podman-login@v1 | |
with: | |
registry: ${{ env.IMAGE_REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build container | |
id: build-image | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
containerfiles: | | |
Container/Containerfile | |
context: Container | |
image: fitbenchmarking-extras | |
tags: latest | |
- name: Push to ghcr.io | |
if: github.event_name == 'push' | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build-image.outputs.image }} | |
tags: ${{ steps.build-image.outputs.tags }} | |
registry: ${{ env.IMAGE_REGISTRY }} | |