File tree Expand file tree Collapse file tree 3 files changed +31
-12
lines changed
Expand file tree Collapse file tree 3 files changed +31
-12
lines changed Original file line number Diff line number Diff line change 1+ name : Publish docker image
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ jobs :
8+ push_to_registry :
9+ name : Push image to docker hub
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : checkout
13+ uses : actions/checkout@v2
14+ - name : Build and push publisher image to docker hub
15+ uses : docker/build-push-action@v1
16+ with :
17+ username : ${{ secrets.DOCKER_USERNAME }}
18+ password : ${{ secrets.DOCKER_PASSWORD }}
19+ path : runbooks
20+ repository : ministryofjustice/cloud-platform-runbooks
21+ tag_with_ref : true
Original file line number Diff line number Diff line change @@ -4,4 +4,11 @@ This directory contains the source files for the runbooks hosted at https://runb
44
55A CircleCI pipeline compiles the source files from this directory to html, and updates the [ target repository] .
66
7+ ## Publisher docker image
8+
9+ A github action builds and pushes the [ publisher docker image] to docker hub,
10+ whenever a new [ release] is created via the github user interface.
11+
712[ target repository ] : https://github.com/ministryofjustice/cloud-platform-runbooks
13+ [ publisher docker image ] : https://hub.docker.com/repository/docker/ministryofjustice/cloud-platform-runbooks
14+ [ release ] : https://github.com/ministryofjustice/cloud-platform/releases
Original file line number Diff line number Diff line change 11IMAGE := ministryofjustice/cloud-platform-runbooks
2- VERSION := 1.7 # Change this in .circleci/config.yml if you update it here
32
4- .built-docker-image : Dockerfile Gemfile Gemfile.lock
5- docker build -t $(IMAGE ) .
6- touch .built-docker-image
7-
8- docker-push : .built-docker-image
9- docker tag $(IMAGE ) $(IMAGE ) :$(VERSION )
10- docker push $(IMAGE ) :$(VERSION )
11-
12- server : .built-docker-image
3+ server :
134 mkdir compiled || true
145 docker run \
156 -p 4567:4567 \
167 -v $$(pwd ) /source:/app/source \
178 -v $$(pwd ) /compiled:/app/compiled \
189 -v $$(pwd ) /config:/app/config \
1910 -it \
20- $(IMAGE ) : $( VERSION ) bundle exec middleman server
11+ $(IMAGE ) bundle exec middleman server
2112
2213# The CircleCI build pipeline does this, so it should never
2314# be necessary to run this task. I'm leaving it here for
2415# reference, and in case we ever need to push changes
2516# manually.
26- build : .built-docker-image
17+ build :
2718 mkdir compiled || true
2819 docker run \
2920 -v $$(pwd ) /source:/app/source \
You can’t perform that action at this time.
0 commit comments