Skip to content

Commit cff056e

Browse files
committed
This ties pushing to Dockerhub with the process of creating a tag in Github, which should help us keep our Releases up to date.
1 parent 8c2b789 commit cff056e

File tree

1 file changed

+44
-7
lines changed

1 file changed

+44
-7
lines changed

.github/workflows/dockerhub-deployment.yml

+44-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,48 @@
11
name: dockerhub-deployment
2+
# test-build is run on any push to a branch.
3+
# test-build-push is run only when a tag is made.
24

35
on:
46
push:
5-
branches: master
7+
branches:
8+
- '*'
9+
tags:
10+
- '*'
611

712
jobs:
13+
test-build:
14+
if: "!startsWith(github.ref, 'refs/tags/')"
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Set up JDK 11
18+
uses: olafurpg/setup-scala@v11
19+
with:
20+
java-version: adopt@1.11
21+
# enable experimental status for docker in order to support SMUI's backend tests that rely on Ryuk images
22+
# (see https://github.com/actions/virtual-environments/issues/368)
23+
- name: Docker experimental Status
24+
run: |
25+
docker version -f '{{.Server.Experimental}}'
26+
- name: Docker restart (with experimental status)
27+
run: |
28+
sudo rm /etc/docker/daemon.json || true
29+
echo $'{ "experimental": true }' | sudo tee /etc/docker/daemon.json
30+
sudo service docker restart
31+
docker version -f '{{.Server.Experimental}}'
32+
- uses: actions/checkout@v2
33+
- name: Setup NPM environment specfic to SMUI
34+
uses: actions/setup-node@v2
35+
with:
36+
node-version: '12'
37+
- run: npm i graceful-fs
38+
- run: npm i resolve
39+
- run: npm i esutils
40+
- run: npm i semver
41+
- name: Run tests
42+
run: sbt test
43+
844
test-build-push:
45+
if: startsWith(github.ref, 'refs/tags/')
946
runs-on: ubuntu-latest
1047
steps:
1148
- name: Set up JDK 11
@@ -39,12 +76,12 @@ jobs:
3976
env:
4077
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
4178
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
42-
# # see https://github.com/marketplace/actions/docker-login
43-
# - name: Login to Docker Hub
44-
# uses: docker/login-action@v1
45-
# with:
46-
# username: ${{ secrets.DOCKERHUB_USERNAME }}
47-
# password: ${{ secrets.DOCKERHUB_TOKEN }}
79+
# # see https://github.com/marketplace/actions/docker-login
80+
# - name: Login to Docker Hub
81+
# uses: docker/login-action@v1
82+
# with:
83+
# username: ${{ secrets.DOCKERHUB_USERNAME }}
84+
# password: ${{ secrets.DOCKERHUB_TOKEN }}
4885
- name: Build & deploy SMUI
4986
run: |
5087
make docker-build-only

0 commit comments

Comments
 (0)