Github Action workflow variable fixes #7
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: Docker images build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'secure-and-more-better' | |
# - 'main' | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- 'main' | |
jobs: | |
build-and-push-images: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
attestations: write | |
id-token: write | |
env: | |
IMAGE_BASE_NAME: 'throwtheswitch/madsciencelab' | |
steps: | |
- name: 'Checkout GitHub Action' | |
uses: actions/checkout@v4 | |
- name: 'Set up QEMU' | |
uses: docker/setup-qemu-action@v3 | |
- name: 'Set up Docker Buildx' | |
uses: docker/setup-buildx-action@v3 | |
- name: 'Login to Docker Hub' | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }}' | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
file: build/standard/docker/Dockerfile | |
build-args: CONTAINER_VERSION=${{ github.ref_name }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ env.IMAGE_BASE_NAME }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}:latest | |
- name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}' | |
env: | |
VARIANT: plugins | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
file: build/${{ env.VARIANT }}/docker/Dockerfile | |
build-args: CONTAINER_VERSION=${{ github.ref_name }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest | |
- name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}' | |
env: | |
VARIANT: arm-none-eabi | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
file: build/${{ env.VARIANT }}/docker/Dockerfile | |
build-args: CONTAINER_VERSION=${{ github.ref_name }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest | |
- name: 'Build and push Docker image ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}' | |
env: | |
VARIANT: arm-none-eabi-plugins | |
uses: docker/build-push-action@v6 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
file: build/${{ env.VARIANT }}/docker/Dockerfile | |
build-args: CONTAINER_VERSION=${{ github.ref_name }} | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:${{ github.ref_name }}, ${{ env.IMAGE_BASE_NAME }}-${{ env.VARIANT }}:latest | |