forked from xagau/Placeholders-X16R
-
Notifications
You must be signed in to change notification settings - Fork 1
124 lines (117 loc) · 5.74 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Docker CD
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
ubuntu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build: ["Debug"]
steps:
- uses: actions/checkout@v1
- name: Get snapshot hash, version & branch
id: snapshot
run: |
echo "GIT_HASH=$(git rev-parse --short=7 "$GITHUB_SHA")" >> $GITHUB_ENV
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//./g')" >> $GITHUB_ENV
echo "TAGS=$(if [ "${{ github.event_name }}" == "push" ] && [ "$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" == "master" ]; then echo "latest,$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')"; elif [ "${{ github.event_name }}" == "pull_request" ]; then echo ""; else echo "$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')"; fi)" >> $GITHUB_ENV
- name: Publish to Registry
env:
BUILD_TYPE: ${{ matrix.build }}
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: veriblock/placeh
username: ${{ secrets.PUBLIC_DOCKERHUB_USERNAME }}
password: ${{ secrets.PUBLIC_DOCKERHUB_PASSWORD }}
dockerfile: ubuntu.Dockerfile
tags: "ubuntu-${{ env. BRANCH }}-${{ env.GIT_HASH }}-${{ matrix.build }}"
- name: Show Tags
run: |
echo "Successfully pushed the following tags:"
echo "----"
echo "ubuntu-${{ env.BRANCH }}-${{ env.GIT_HASH }}-${{ matrix.build }}"
echo "----"
ubuntu-asan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Get snapshot hash, version & branch
id: snapshot
run: |
echo "GIT_HASH=$(git rev-parse --short=7 "$GITHUB_SHA")" >> $GITHUB_ENV
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//./g')" >> $GITHUB_ENV
echo "TAGS=$(if [ "${{ github.event_name }}" == "push" ] && [ "$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" == "master" ]; then echo "latest-asan,$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')"; elif [ "${{ github.event_name }}" == "pull_request" ]; then echo ""; else echo "$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')"; fi)" >> $GITHUB_ENV
- name: Publish to Registry
env:
BUILD_TYPE: ${{ matrix.build }}
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: veriblock/placeh
username: ${{ secrets.PUBLIC_DOCKERHUB_USERNAME }}
password: ${{ secrets.PUBLIC_DOCKERHUB_PASSWORD }}
dockerfile: ubuntu-asan.Dockerfile
tags: "ubuntu-${{ env. BRANCH }}-${{ env.GIT_HASH }}-asan"
- name: Show Tags
run: |
echo "Successfully pushed the following tags:"
echo "----"
echo "ubuntu-${{ env.BRANCH }}-${{ env.GIT_HASH }}-asan"
echo "----"
ubuntu-valgrind:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Get snapshot hash, version & branch
id: snapshot
run: |
echo "GIT_HASH=$(git rev-parse --short=7 "$GITHUB_SHA")" >> $GITHUB_ENV
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//./g')" >> $GITHUB_ENV
echo "TAGS=$(if [ "${{ github.event_name }}" == "push" ] && [ "$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" == "master" ]; then echo "latest-valgrind,$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')"; elif [ "${{ github.event_name }}" == "pull_request" ]; then echo ""; else echo "$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')"; fi)" >> $GITHUB_ENV
- name: Publish to Registry
env:
BUILD_TYPE: ${{ matrix.build }}
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: veriblock/placeh
username: ${{ secrets.PUBLIC_DOCKERHUB_USERNAME }}
password: ${{ secrets.PUBLIC_DOCKERHUB_PASSWORD }}
dockerfile: ubuntu-valgrind.Dockerfile
tags: "ubuntu-${{ env. BRANCH }}-${{ env.GIT_HASH }}-valgrind"
- name: Show Tags
run: |
echo "Successfully pushed the following tags:"
echo "----"
echo "ubuntu-${{ env.BRANCH }}-${{ env.GIT_HASH }}-valgrind"
echo "----"
alpine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Get snapshot hash, version & branch
id: snapshot
run: |
echo "GIT_HASH=$(git rev-parse --short=7 "$GITHUB_SHA")" >> $GITHUB_ENV
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//./g')" >> $GITHUB_ENV
echo "TAGS=$(if [ "${{ github.event_name }}" == "push" ] && [ "$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" == "master" ]; then echo "latest,$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')"; elif [ "${{ github.event_name }}" == "pull_request" ]; then echo ""; else echo "$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')"; fi)" >> $GITHUB_ENV
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
dockerfile: alpine.Dockerfile
name: veriblock/placeh
username: ${{ secrets.PUBLIC_DOCKERHUB_USERNAME }}
password: ${{ secrets.PUBLIC_DOCKERHUB_PASSWORD }}
tags: "${{ env.BRANCH }}-${{ env.GIT_HASH }},${{ github.sha }}"
- name: Show Tags
run: |
echo "Successfully pushed the following tags:"
echo "----"
echo "$(IFS=',' read -ra TAGS <<< "$(if [ "${{ github.event_name }}" == "push" ] && [ "${BRANCH}" == "master" ]; then echo "latest,${BRANCH}"; elif [ "${{ github.event_name }}" == "pull_request" ]; then echo ""; else echo "${BRANCH}"; fi)"; for i in "${TAGS[@]}"; do echo $i; done)"
echo "${{ env.BRANCH }}-${{ env.GIT_HASH }}"
echo "${{ github.sha }}"
echo "----"