generated from crazyfactory/ts-react-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (23 loc) · 999 Bytes
/
docker.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
name: Docker
on: [push]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: build docker
run: |
export TAG=`git rev-parse --short=4 ${GITHUB_SHA}`
docker build . -t fossapps/feature.manager.ui:$TAG
- name: Push docker images
run: |
TAG=`git rev-parse --short=4 ${GITHUB_SHA}`
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login --username "${{ secrets.DOCKERHUB_LOGIN }}" --password-stdin
docker push fossapps/feature.manager.ui:$TAG
- name: Push Stable Image (Only master)
if: github.ref == 'refs/heads/master'
run: |
TAG=`git rev-parse --short=4 ${GITHUB_SHA}`
echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login --username "${{ secrets.DOCKERHUB_LOGIN }}" --password-stdin
docker tag fossapps/feature.manager.ui:$TAG fossapps/feature.manager.ui:stable
docker push fossapps/feature.manager.ui:stable