File tree 2 files changed +44
-8
lines changed
2 files changed +44
-8
lines changed Original file line number Diff line number Diff line change 4
4
push :
5
5
branches :
6
6
trunk
7
+ pull_request :
8
+ branches :
9
+ trunk
7
10
8
11
jobs :
9
12
build-and-test :
13
+ # Skip job based on the commit message
14
+ if : contains(toJson(github.event.commits), '[skip ci]') == false
10
15
name : Build & test Docker images with random user
11
16
runs-on : ubuntu-18.04
12
17
strategy :
@@ -16,20 +21,18 @@ jobs:
16
21
- uses : actions/checkout@v1
17
22
- name : Output Docker info
18
23
run : docker info
19
- - name : Gets tag as env var if present
20
- run : echo ::set-env name=GITHUB_TAG::${GITHUB_REF#refs/*/}
21
- - name : Output GITHUB_TAG if present
22
- run : |
23
- echo $GITHUB_TAG
24
- echo ${{ env.GITHUB_TAG }}
25
24
- name : Set up Python 3.8
26
25
uses : actions/setup-python@v2
27
26
with :
28
27
python-version : 3.8
28
+ - name : Extract branch Name
29
+ run : echo "::set-env name=BRANCH::$(echo ${GITHUB_REF##*/})"
30
+ - name : Output branch name
31
+ run : echo ${BRANCH}
29
32
- name : Build Docker images
30
- run : VERSION=${GITHUB_SHA } make build
33
+ run : VERSION=${BRANCH } make build
31
34
- name : Test Docker images
32
- run : USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${GITHUB_SHA } make test
35
+ run : USE_RANDOM_USER_ID=${USE_RANDOM_USER} VERSION=${BRANCH } make test
33
36
env :
34
37
USE_RANDOM_USER : ${{ matrix.use-random-user }}
35
38
Original file line number Diff line number Diff line change
1
+ name : Deploys
2
+
3
+ on :
4
+ push :
5
+ tags :
6
+
7
+ jobs :
8
+ build-and-test :
9
+ # Skip job based on the commit message
10
+ if : contains(toJson(github.event.commits), '[skip ci]') == false
11
+ name : Deploy Docker images
12
+ runs-on : ubuntu-18.04
13
+ steps :
14
+ - uses : actions/checkout@v1
15
+ - name : Output Docker info
16
+ run : docker info
17
+ - name : Gets tag as env var if present
18
+ run : echo ::set-env name=TAG::${GITHUB_REF#refs/*/}
19
+ - name : Output tag if present
20
+ run : echo ${TAG}
21
+ - name : Build
22
+ run : VERSION="${TAG}" make build
23
+ - name : Login Docker Hub
24
+ run : docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
25
+ env :
26
+ DOCKER_USERNAME : ${{secrets.DOCKER_USERNAME}}
27
+ DOCKER_PASSWORD : ${{secrets.DOCKER_PASSWORD}}
28
+ - name : Deploy new images
29
+ run : VERSION="${TRAVIS_TAG}" make release
30
+ # - name: Deploy tag latest
31
+ # run: VERSION="${TRAVIS_TAG}" make tag_latest
32
+ # - name: Deploy release latest
33
+ # run: VERSION="${TRAVIS_TAG}" make release_latest
You can’t perform that action at this time.
0 commit comments