Skip to content

Merge pull request #34 from Arlet2/add-restrictions #2

Merge pull request #34 from Arlet2/add-restrictions

Merge pull request #34 from Arlet2/add-restrictions #2

Workflow file for this run

name: Docker Build and Publish
on:
push:
tags:
- "*"
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
jobs:
build-and-publish:
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_USERNAME }}/go-swagger3
flavor: latest=true
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Build and tag Docker image
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.ref_type == 'tag' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}