Skip to content

Commit 83efb55

Browse files
committed
First go at Docker image builds in Github Action
1 parent 588b79a commit 83efb55

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

.github/workflows/main.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Docker image build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- 'secure-and-more-better'
8+
# - 'main'
9+
tags:
10+
- '*'
11+
pull_request:
12+
branches:
13+
- 'main'
14+
15+
jobs:
16+
build-and-push-images:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
attestations: write
22+
id-token: write
23+
24+
steps:
25+
- name: 'Checkout GitHub Action'
26+
uses: actions/checkout@v4
27+
28+
- name: 'Set up QEMU'
29+
uses: docker/setup-qemu-action@v3
30+
31+
- name: 'Set up Docker Buildx'
32+
uses: docker/setup-buildx-action@v3
33+
34+
- name: 'Login to Docker Hub'
35+
if: github.event_name != 'pull_request'
36+
uses: docker/login-action@v3
37+
with:
38+
username: ${{ secrets.DOCKERHUB_USERNAME }}
39+
password: ${{ secrets.DOCKERHUB_TOKEN }}
40+
41+
- name: 'Build and push Docker image throwtheswitch/madsciencelab:${{ github.ref_name }}'
42+
id: push
43+
uses: docker/build-push-action@v6
44+
with:
45+
platforms: linux/amd64,linux/arm64
46+
file: {context}/build/standard/docker/Dockerfile
47+
build-args: CONTAINER_VERSION=${{ github.ref_name }}
48+
push: ${{ github.event_name != 'pull_request' }}
49+
tags: throwtheswitch/madsciencelab:${{ github.ref_name }}, throwtheswitch/madsciencelab:latest
50+
51+
- name: 'Build and push Docker image throwtheswitch/madsciencelab-plugins:${{ github.ref_name }}'
52+
id: push
53+
uses: docker/build-push-action@v6
54+
with:
55+
platforms: linux/amd64,linux/arm64
56+
file: {context}/build/plugins/docker/Dockerfile
57+
build-args: CONTAINER_VERSION=${{ github.ref_name }}
58+
push: ${{ github.event_name != 'pull_request' }}
59+
tags: throwtheswitch/madsciencelab-plugins:${{ github.ref_name }}, throwtheswitch/madsciencelab-plugins:latest
60+
61+
- name: 'Build and push Docker image throwtheswitch/madsciencelab-arm-none-eabi:${{ github.ref_name }}'
62+
id: push
63+
uses: docker/build-push-action@v6
64+
with:
65+
platforms: linux/amd64,linux/arm64
66+
file: {context}/build/arm-none-eabi/docker/Dockerfile
67+
build-args: CONTAINER_VERSION=${{ github.ref_name }}
68+
push: ${{ github.event_name != 'pull_request' }}
69+
tags: throwtheswitch/madsciencelab-arm-none-eabi:${{ github.ref_name }}, throwtheswitch/madsciencelab-arm-none-eabi:latest
70+
71+
- name: 'Build and push Docker image throwtheswitch/madsciencelab-arm-none-eabi-plugins:${{ github.ref_name }}'
72+
id: push
73+
uses: docker/build-push-action@v6
74+
with:
75+
platforms: linux/amd64,linux/arm64
76+
file: {context}/build/arm-none-eabi-plugins/docker/Dockerfile
77+
build-args: CONTAINER_VERSION=${{ github.ref_name }}
78+
push: ${{ github.event_name != 'pull_request' }}
79+
tags: throwtheswitch/madsciencelab-arm-none-eabi-plugins:${{ github.ref_name }}, throwtheswitch/madsciencelab-arm-none-eabi-plugins:latest
80+

0 commit comments

Comments
 (0)