generated from NuclearRedeye/typescript-web-application
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.7 KB
/
cd.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
name: Continuous Deployment
on:
push:
branches:
- master
pull_request:
jobs:
cd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checking code for styling issues
run: |
make format
- name: Checking code for linting issues
run: |
make lint
- name: Checking unit tests pass
run: |
make test
- name: Checking 'debug' code builds
run: |
sudo make debug
- name: Checking 'release' code builds
run: |
sudo make release
- name: Publishing 'unstable' release to https://hub.docker.com
if: github.ref == 'refs/heads/master'
run: |
docker login -u $DOCKER_USERNAME -p $DOCKER_TOKEN
docker build --no-cache -t $DOCKER_USERNAME/$REPO_NAME:$GITHUB_SHA -t $DOCKER_USERNAME/$REPO_NAME:unstable .
docker push --all-tags $DOCKER_USERNAME/$REPO_NAME
env:
REPO_NAME: ${{ github.event.repository.name }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
- name: Publishing 'stable' release to https://hub.docker.com
if: contains(github.ref, 'refs/tags/v')
run: |
docker login -u $DOCKER_USERNAME -p $DOCKER_TOKEN
docker build --no-cache -t $DOCKER_USERNAME/$REPO_NAME:${GITHUB_REF/refs\/tags\/v/} -t $DOCKER_USERNAME/$REPO_NAME:stable -t $DOCKER_USERNAME/$REPO_NAME:latest .
docker push --all-tags $DOCKER_USERNAME/$REPO_NAME
env:
REPO_NAME: ${{ github.event.repository.name }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}