taking a stab at github actions

This commit is contained in:
Josh 2023-04-27 18:32:34 -04:00
parent 8c4669b5ee
commit 5896f5667e

39
.github/workflows/docker-publish.yml vendored Normal file
View file

@ -0,0 +1,39 @@
---
name: docker-publish
on:
workflow_dispatch:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker metadata
id: meta
uses: docker/metadata-action@v4
with:
images: joshkaiju/gophernicus
- name: Setup Docker build
uses: docker/setup-buildx-action@v2
- name: Login to Docker hub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build and publish
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}