Skip to content
Open
Show file tree
Hide file tree
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
29 changes: 29 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: docker

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build docker image
run: make build
- name: Deploy the Docker image
run: make publish
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
CI_BUILD_NUMBER: ${{ github.run_number }}
- name: Publish to github docker registry
run: make publish-gh
env:
GH_REGISTRY_USERNAME: ${{ secrets.GITHUB_REGISTRY_USERNAME }}
GH_REGISTRY_PASSWORD: ${{ secrets.GITHUB_REGISTRY_TOKEN }}
CI_BUILD_NUMBER: ${{ github.run_number }}
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PROJECT_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
CI_BUILD_NUMBER ?= $(USER)-snapshot

VERSION ?= 0.1.$(CI_BUILD_NUMBER)
VERSION ?= 0.2.$(CI_BUILD_NUMBER)

PUBLISH_TAG=meetup/sbt-builder:$(VERSION)
# docker image push is only supported with a tag of the format :owner/:repo_name/:image_name.
Expand All @@ -22,23 +22,22 @@ list:
no_op__:

#Assemles the software artifact using the defined build image.
package:
build:
docker build -t $(PUBLISH_TAG) .

component-test:
docker build -f test/docker/Dockerfile \
-t $(TESTER_TAG) test
docker run -it --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-e IMAGE_TAG=$(PUBLISH_TAG) \
$(TESTER_TAG)

#Pushes the container to the docker registry/repository.
publish: package component-test
publish: build component-test
@docker push $(PUBLISH_TAG)

publish-github-registry: package component-test
@docker login docker.pkg.github.com --username $(GITHUB_REGISTRY_USERNAME) -p $(GITHUB_REGISTRY_TOKEN)
publish-github-registry: build component-test
@docker login docker.pkg.github.com -u $(GITHUB_REGISTRY_USERNAME) -p $(GITHUB_REGISTRY_TOKEN)
@docker tag $(PUBLISH_TAG) $(GITHUB_REGISTRY_TAG)
@docker push $(GITHUB_REGISTRY_TAG)

Expand Down