1- # Snipe-IT (Alpine) Docker image build for hub.docker.com
2- name : Docker images (Alpine )
1+ # Snipe-IT Docker image build for hub.docker.com
2+ name : Docker Intel/amd64 images (Ubuntu )
33
44# Run this Build for all pushes to 'master' or develop branch, or tagged releases.
55# Also run for PRs to ensure PR doesn't break Docker build process
@@ -19,10 +19,75 @@ permissions:
1919 contents : read
2020
2121jobs :
22- docker :
22+ docker-ubuntu-arm :
2323 # Ensure this job never runs on forked repos. It's only executed for 'grokability/snipe-it'
2424 if : github.repository == 'grokability/snipe-it'
25- runs-on : ubuntu-latest
25+ runs-on : ubuntu-24.04-arm
26+ env :
27+ # Define tags to use for Docker images based on Git tags/branches (for docker/metadata-action)
28+ # For a new commit on default branch (master), use the literal tag 'latest' on Docker image.
29+ # For a new commit on other branches, use the branch name as the tag for Docker image.
30+ # For a new tag, copy that tag name as the tag for Docker image.
31+ IMAGE_TAGS : |
32+ type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
33+ type=ref,event=branch,enable=${{ !endsWith(github.ref, github.event.repository.default_branch) }}
34+ type=ref,event=tag
35+ type=semver,pattern=v{{major}}-latest
36+ # Define default tag "flavor" for docker/metadata-action per
37+ # https://github.com/docker/metadata-action#flavor-input
38+ # We turn off 'latest' tag by default.
39+ TAGS_FLAVOR : |
40+ latest=false
41+
42+ steps :
43+ # https://github.com/actions/checkout
44+ - name : Checkout codebase
45+ uses : actions/checkout@v4
46+
47+ # https://github.com/docker/setup-buildx-action
48+ - name : Setup Docker Buildx
49+ uses : docker/setup-buildx-action@v3
50+
51+ # https://github.com/docker/login-action
52+ - name : Login to DockerHub
53+ # Only login if not a PR, as PRs only trigger a Docker build and not a push
54+ if : github.event_name != 'pull_request'
55+ uses : docker/login-action@v3
56+ with :
57+ username : ${{ secrets.DOCKER_USERNAME }}
58+ password : ${{ secrets.DOCKER_ACCESS_TOKEN }}
59+
60+ # ##############################################
61+ # Build/Push the 'grokability/snipe-it' image
62+ # ##############################################
63+ # https://github.com/docker/metadata-action
64+ # Get Metadata for docker_build step below
65+ - name : Sync metadata (tags, labels) from GitHub to Docker for 'snipe-it' image
66+ id : meta_build
67+ uses : docker/metadata-action@v5
68+ with :
69+ images : grokability/snipe-it
70+ tags : ${{ env.IMAGE_TAGS }}
71+ flavor : ${{ env.TAGS_FLAVOR }}
72+
73+ # https://github.com/docker/build-push-action
74+ - name : Build and push 'snipe-it' image
75+ id : docker_build
76+ uses : docker/build-push-action@v6
77+ with :
78+ context : .
79+ file : ./Dockerfile
80+ platforms : linux/arm64
81+ # For pull requests, we run the Docker build (to ensure no PR changes break the build),
82+ # but we ONLY do an image push to DockerHub if it's NOT a PR
83+ push : ${{ github.event_name != 'pull_request' }}
84+ # Use tags / labels provided by 'docker/metadata-action' above
85+ tags : ${{ steps.meta_build.outputs.tags }}
86+ labels : ${{ steps.meta_build.outputs.labels }}
87+ docker-alpine-arm :
88+ # Ensure this job never runs on forked repos. It's only executed for 'grokability/snipe-it'
89+ if : github.repository == 'grokability/snipe-it'
90+ runs-on : ubuntu-24.04-arm
2691 env :
2792 # Define tags to use for Docker images based on Git tags/branches (for docker/metadata-action)
2893 # For a new commit on default branch (master), use the literal tag 'latest' on Docker image.
77142 with :
78143 context : .
79144 file : ./Dockerfile.alpine
80- platforms : linux/amd64,linux/ arm64
145+ platforms : linux/arm64
81146 # For pull requests, we run the Docker build (to ensure no PR changes break the build),
82147 # but we ONLY do an image push to DockerHub if it's NOT a PR
83148 push : ${{ github.event_name != 'pull_request' }}
0 commit comments