fix: add image building workload on tag creation

This commit is contained in:
ᗪєνιη ᗷυнʟ
2021-01-23 12:18:41 -05:00
committed by Senan Kelly
parent 83fae4df63
commit 3899bc7e3a

44
.github/workflows/image.yml vendored Normal file
View File

@@ -0,0 +1,44 @@
name: main
on:
push:
branches:
- master
tags:
- v*
workflow_dispatch:
env:
REGISTRY_IMAGE: sentriz/gonic
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci-skip]')"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true
version: latest
driver-opts: image=moby/buildkit:master
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build and Push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.REGISTRY_IMAGE }}:latest
${{ env.REGISTRY_IMAGE }}:${GITHUB_REF##*/}