-
Notifications
You must be signed in to change notification settings - Fork 24
88 lines (85 loc) · 3.06 KB
/
dockerhub-deployment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: dockerhub-deployment
# test-build is run on any push to a branch.
# test-build-push is run only when a tag is made.
on:
push:
branches:
- '*'
tags:
- '*'
jobs:
test-build:
if: "!startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest
steps:
- name: Set up JDK 11
uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
# enable experimental status for docker in order to support SMUI's backend tests that rely on Ryuk images
# (see https://github.com/actions/virtual-environments/issues/368)
- name: Docker experimental Status
run: |
docker version -f '{{.Server.Experimental}}'
- name: Docker restart (with experimental status)
run: |
sudo rm /etc/docker/daemon.json || true
echo $'{ "experimental": true }' | sudo tee /etc/docker/daemon.json
sudo service docker restart
docker version -f '{{.Server.Experimental}}'
- uses: actions/checkout@v2
- name: Setup NPM environment specfic to SMUI
uses: actions/setup-node@v2
with:
node-version: '12'
- run: npm i graceful-fs
- run: npm i resolve
- run: npm i esutils
- run: npm i semver
- name: Run tests
run: sbt test
test-build-push:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Set up JDK 11
uses: olafurpg/setup-scala@v11
with:
java-version: [email protected]
# enable experimental status for docker in order to support SMUI's backend tests that rely on Ryuk images
# (see https://github.com/actions/virtual-environments/issues/368)
- name: Docker experimental Status
run: |
docker version -f '{{.Server.Experimental}}'
- name: Docker restart (with experimental status)
run: |
sudo rm /etc/docker/daemon.json || true
echo $'{ "experimental": true }' | sudo tee /etc/docker/daemon.json
sudo service docker restart
docker version -f '{{.Server.Experimental}}'
- uses: actions/checkout@v2
- name: Setup NPM environment specfic to SMUI
uses: actions/setup-node@v2
with:
node-version: '12'
- run: npm i graceful-fs
- run: npm i resolve
- run: npm i esutils
- run: npm i semver
- name: Run tests
run: sbt test
# see https://github.community/t/github-actions-docker-login/16053/3
- run: echo "${DOCKER_PASSWORD}" | docker login -u ${DOCKER_USERNAME} --password-stdin
env:
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}
# # see https://github.com/marketplace/actions/docker-login
# - name: Login to Docker Hub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & deploy SMUI
run: |
make docker-build-only
make docker-push