Add workflow for docker push

This commit is contained in:
jsondoe9 2022-02-07 19:53:21 +01:00
parent e394c14a70
commit 215149bf50

45
.github/workflows/build_n_push.yml vendored Normal file
View file

@ -0,0 +1,45 @@
name: "Build and push"
on:
push:
branches:
- "master"
workflow_dispatch:
jobs:
build_n_push:
name: Build and push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker metadata
id: meta
uses: docker/metadata-action@v3
with:
images: jsondoe9/metube
tags: |
type=sha,prefix=sha-,format=short
type=raw,value=latest,enable=true
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}