Add workflow to publish image

This commit is contained in:
Max Isom 2020-11-18 14:17:11 -05:00
parent 42fceacf65
commit 5c768adf61
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880
2 changed files with 43 additions and 1 deletions

View file

@ -1,6 +1,6 @@
name: Lint & build
on: [push, pull_request]
on: [pull_request]
jobs:
build:

42
.github/workflows/publish-image.yml vendored Normal file
View file

@ -0,0 +1,42 @@
name: Publish Docker image
on:
push:
branches: master
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: Set up Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
push: true
tags: codetheweb/muse:latest
platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x
- name: Update Docker Hub description
uses: peter-evans/dockerhub-description@v2.1.0
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_REPOSITORY: peterevans/dockerhub-description