-
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.
- Loading branch information
1 parent
d2b152a
commit 242f9e0
Showing
1 changed file
with
55 additions
and
0 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,55 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout repository | ||
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 | ||
# Workaround to fix error: | ||
# failed to push: failed to copy: io: read/write on closed pipe | ||
# See https://github.com/docker/build-push-action/issues/761 | ||
with: | ||
driver-opts: | | ||
image=moby/buildkit:v0.12.0 | ||
- | ||
name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ GITHUB_TOKEN }} | ||
- | ||
name: Generate docker image tags | ||
id: metadata | ||
uses: docker/metadata-action@v4 | ||
with: | ||
flavor: | | ||
# Disable latest tag | ||
latest=false | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
# Tag with branch name | ||
type=ref,event=branch | ||
# Tag with git tag on release | ||
type=ref,event=tag | ||
type=raw,value=release,enable=${{ github.event_name == 'release' }} | ||
- | ||
name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |