Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker publish github action #394

Merged
merged 1 commit into from
Apr 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/dockerpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Publishes built images to the docker hub.
#
# - Merges to master are published as `kegbot/server:master` as
# well as `kegbot/server:sha-<shortsha>`.
# - Releases are published as `kegbot/server:latest` as well as
# `kegbot/server:<tag>`
#
# Right now we prefer Docker Hub instead of GitHub Package Registry
# because GitHub requires login even for public repo pulls, and that's
# more work for the average user. Change to the following `with:`
# settings to use GitHub Package index:
#
# username: $GITHUB_ACTOR
# password: ${{ secrets.GITHUB_TOKEN }}
# registry: docker.pkg.github.com
# repository: kegbot/kegbot-server/kegbot-server

name: Docker Publish

on:
push:
branches:
- master
release:
types: [published]

jobs:
publish-as-latest:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
repository: kegbot/server
tag_with_ref: true
tag_with_sha: true

publish-as-release:
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
repository: kegbot/server
tag_with_ref: true
tags: latest