-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First go at Docker image builds in Github Action
- Loading branch information
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Docker image 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 | ||
|
||
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 throwtheswitch/madsciencelab:${{ github.ref_name }}' | ||
id: push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
file: {context}/build/standard/docker/Dockerfile | ||
build-args: CONTAINER_VERSION=${{ github.ref_name }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: throwtheswitch/madsciencelab:${{ github.ref_name }}, throwtheswitch/madsciencelab:latest | ||
|
||
- name: 'Build and push Docker image throwtheswitch/madsciencelab-plugins:${{ github.ref_name }}' | ||
id: push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
file: {context}/build/plugins/docker/Dockerfile | ||
build-args: CONTAINER_VERSION=${{ github.ref_name }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: throwtheswitch/madsciencelab-plugins:${{ github.ref_name }}, throwtheswitch/madsciencelab-plugins:latest | ||
|
||
- name: 'Build and push Docker image throwtheswitch/madsciencelab-arm-none-eabi:${{ github.ref_name }}' | ||
id: push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
file: {context}/build/arm-none-eabi/docker/Dockerfile | ||
build-args: CONTAINER_VERSION=${{ github.ref_name }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: throwtheswitch/madsciencelab-arm-none-eabi:${{ github.ref_name }}, throwtheswitch/madsciencelab-arm-none-eabi:latest | ||
|
||
- name: 'Build and push Docker image throwtheswitch/madsciencelab-arm-none-eabi-plugins:${{ github.ref_name }}' | ||
id: push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
file: {context}/build/arm-none-eabi-plugins/docker/Dockerfile | ||
build-args: CONTAINER_VERSION=${{ github.ref_name }} | ||
push: ${{ github.event_name != 'pull_request' }} | ||
tags: throwtheswitch/madsciencelab-arm-none-eabi-plugins:${{ github.ref_name }}, throwtheswitch/madsciencelab-arm-none-eabi-plugins:latest | ||
|