-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gha): add build & publish docker image workflow (#8)
* chore(gha): add build docker image workflow Signed-off-by: Kaan Yagci <kaan.yagci@makepad.fr> * drop: temporary remove the path constraints Signed-off-by: Kaan Yagci <kaan.yagci@makepad.fr> * refactor(gha): rename GHA workflow Signed-off-by: Kaan Yagci <kaan.yagci@makepad.fr> * fix(gha): invalid tag Signed-off-by: Kaan Yagci <kaan.yagci@makepad.fr> * chore: update Dockerfile with DEBIAN_TAG Signed-off-by: Kaan Yagci <kaan.yagci@makepad.fr> * chore(gha): update build workflow Signed-off-by: Kaan Yagci <kaan.yagci@makepad.fr> * fix(gha): invalid image tag issue Signed-off-by: Kaan Yagci <kaan.yagci@makepad.fr> --------- Signed-off-by: Kaan Yagci <kaan.yagci@makepad.fr>
- Loading branch information
Showing
2 changed files
with
59 additions
and
1 deletion.
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,57 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
- edited | ||
|
||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths: | ||
- core/** | ||
- forward-proxy/** | ||
- Dockerfile | ||
- Makefile | ||
|
||
concurrency: | ||
group: "${{ github.workflow }}-${{ github.ref_name }}-${{ github.event_name }}" | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
DEBIAN_TAG: ["trixie", "trixie-slim", "bullseye", "bullseye-slim", "buster", "buster-slim", "bookworm-slim", "bookworm"] | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4.1.2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3.2.0 | ||
|
||
- name: Login to DockerHub | ||
if: github.event_name == 'release' | ||
uses: docker/login-action@v3.1.0 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and Push Docker image | ||
uses: docker/build-push-action@v5.3.0 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
platforms: linux/amd64,linux/arm64/v8 | ||
push: ${{ github.event_name == 'release' }} | ||
tags: makepad/sfp:${{ (github.event_name == 'release' && github.event.release.tag_name) || github.sha }}-${{ matrix.DEBIAN_TAG }} | ||
build-args: | | ||
DEBIAN_TAG=${{ matrix.DEBIAN_TAG }} | ||
cache-from: type=registry,ref=makepad/sfp:${{( github.event_name == 'release' && github.event.release.tag_name) || github.sha }}-${{ matrix.DEBIAN_TAG }} | ||
cache-to: type=inline |
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