-
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 <[email protected]> * drop: temporary remove the path constraints Signed-off-by: Kaan Yagci <[email protected]> * refactor(gha): rename GHA workflow Signed-off-by: Kaan Yagci <[email protected]> * fix(gha): invalid tag Signed-off-by: Kaan Yagci <[email protected]> * chore: update Dockerfile with DEBIAN_TAG Signed-off-by: Kaan Yagci <[email protected]> * chore(gha): update build workflow Signed-off-by: Kaan Yagci <[email protected]> * fix(gha): invalid image tag issue Signed-off-by: Kaan Yagci <[email protected]> --------- Signed-off-by: Kaan Yagci <[email protected]>
- 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/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
|
||
- name: Login to DockerHub | ||
if: github.event_name == 'release' | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and Push Docker image | ||
uses: docker/[email protected] | ||
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