|
1 | 1 | 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. |
2 | 4 |
|
3 | 5 | on:
|
4 | 6 | push:
|
5 |
| - branches: master |
| 7 | + branches: |
| 8 | + - '*' |
| 9 | + tags: |
| 10 | + - '*' |
6 | 11 |
|
7 | 12 | 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 | + |
8 | 44 | test-build-push:
|
| 45 | + if: startsWith(github.ref, 'refs/tags/') |
9 | 46 | runs-on: ubuntu-latest
|
10 | 47 | steps:
|
11 | 48 | - name: Set up JDK 11
|
@@ -39,12 +76,12 @@ jobs:
|
39 | 76 | env:
|
40 | 77 | DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
41 | 78 | 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 }} |
48 | 85 | - name: Build & deploy SMUI
|
49 | 86 | run: |
|
50 | 87 | make docker-build-only
|
|
0 commit comments