Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This ties pushing to Dockerhub with the process of creating a tag in … #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
51 changes: 44 additions & 7 deletions .github/workflows/dockerhub-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,48 @@
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: master
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
Expand Down Expand Up @@ -39,12 +76,12 @@ jobs:
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 }}
# # 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
Expand Down
Loading