sadly had to bring back this adaptive fucniton #22
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: Image CD | |
# The events that trigger the workflow | |
on: | |
push: | |
branches: [ develop ] | |
release: | |
types: [ published ] | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- os: Ubuntu22.04 | |
file: Doc/MaCh3DockerFiles/Ubuntu22.04/Dockerfile | |
tag_latest: ubuntu22.04latest | |
tag_release: ubuntu22.04v1.1.0 | |
- os: Alma9 | |
file: Doc/MaCh3DockerFiles/Alma9/Dockerfile | |
tag_latest: alma9latest | |
tag_release: alma9v1.1.0 | |
- os: Fedora32 | |
file: Doc/MaCh3DockerFiles/Fedora32/Dockerfile | |
tag_latest: fedora32latest | |
tag_release: fedora32v1.1.0 | |
name: Image CD ${{ matrix.os }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Log in to GitHub Container Registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Build Docker image | |
run: | | |
if [ "${{ github.event_name }}" == 'release' ]; then | |
docker build . --file ${{ matrix.file }} --tag ghcr.io/${{ github.repository_owner }}/mach3:${{ matrix.tag_release }} --build-arg MACH3_VERSION=develop | |
else | |
docker build . --file ${{ matrix.file }} --tag ghcr.io/${{ github.repository_owner }}/mach3:${{ matrix.tag_latest }} --build-arg MACH3_VERSION=develop | |
fi | |
- name: Push Docker image | |
run: | | |
if [ "${{ github.event_name }}" == 'release' ]; then | |
docker push ghcr.io/${{ github.repository_owner }}/mach3:${{ matrix.tag_release }} | |
else | |
docker push ghcr.io/${{ github.repository_owner }}/mach3:${{ matrix.tag_latest }} | |
fi |