Automate docker build and upload (#703)

* add basic master builds

* fix branch name

* tidy up

* update to work from master
This commit is contained in:
Ruaridh 2020-10-30 17:38:30 +00:00 committed by GitHub
parent 1442deb3dc
commit 36a32d7962
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,6 +103,24 @@ jobs:
target: link-check target: link-check
description: "Check url links are not broken" description: "Check url links are not broken"
docker-build-and-push:
# adapted from: https://circleci.com/blog/using-circleci-workflows-to-replicate-docker-hub-automated-builds/
environment:
IMAGE_NAME: kava/kava
docker:
- image: circleci/buildpack-deps:stretch
steps:
- checkout
- setup_remote_docker
- run:
name: Build Docker image
command: docker build -t $IMAGE_NAME:$CIRCLE_BRANCH .
- run:
name: Publish Docker Image to Docker Hub
command: |
echo "$DOCKERHUB_KEY" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
docker push $IMAGE_NAME:$CIRCLE_BRANCH
workflows: workflows:
version: 2 version: 2
@ -127,3 +145,9 @@ workflows:
- broken-link-check: - broken-link-check:
requires: requires:
- setup-dependencies - setup-dependencies
upload-docker-images:
jobs:
- docker-build-and-push:
filters:
branches:
only: master