-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Derek Straka <[email protected]>
- Loading branch information
1 parent
c9c174c
commit aa7a569
Showing
3 changed files
with
59 additions
and
3 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,54 @@ | ||
--- | ||
name: Publish | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- "main" | ||
tags: | ||
- "**" | ||
pull_request: | ||
types: [opened, reopened, synchronize, ready_for_review] | ||
|
||
env: | ||
ORGANIZATION: "derekstraka" | ||
IMAGE_NAME: "yocto" | ||
|
||
jobs: | ||
build_push_latest: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Build and save image tag | ||
run: echo "IMAGE_TAG=$([ "${GITHUB_REF_TYPE}" == 'tag' ] && echo "${GITHUB_REF_NAME}" || echo "latest")" >> $GITHUB_ENV | ||
|
||
- name: Build docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
load: true | ||
tags: ${{ env.ORGANIZATION }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: ./Dockerfile | ||
push: ${{ (github.event.ref == 'refs/heads/main') || (startsWith( github.event.ref, 'refs/tags')) }} | ||
tags: ${{ env.ORGANIZATION }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG}} |
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
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