Skip to content

Merge pull request #31 from iquzart/development #31

Merge pull request #31 from iquzart/development

Merge pull request #31 from iquzart/development #31

name: Build and Push to Docker Hub
on:
# schedule:
# - cron: '0 10 * * 0'
push:
branches:
- '**'
tags:
- 'v*.*.*'
paths-ignore:
- 'deployment/**'
- 'azure-pipeline/**'
- '.github/**'
pull_request:
env:
DOCKER_IMAGE: diquzart/go-app
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.DOCKER_IMAGE }}
tags: |
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{raw}}
type=sha
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: ./Containerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
build-args: |
VERSION=${{ github.sha }}