File tree 4 files changed +93
-76
lines changed
4 files changed +93
-76
lines changed Original file line number Diff line number Diff line change
1
+ name : CI Pipeline
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - ' *'
7
+ tags :
8
+ - ' *'
9
+
10
+ jobs :
11
+ build_binaries :
12
+ name : Build Binaries
13
+ runs-on : ubuntu-20.04
14
+
15
+ steps :
16
+ - name : Set up Go
17
+ uses : actions/setup-go@v4
18
+ with :
19
+ go-version : 1.22.8
20
+
21
+ - name : Checkout Code
22
+ uses : actions/checkout@v4
23
+
24
+ - name : Build
25
+ run : |
26
+ export PATH="$GOBIN:$PATH"
27
+ . build.sh
28
+ env :
29
+ ARTIFACTS : ${{ runner.temp }}/artifacts
30
+ shell : bash
31
+
32
+ - name : Upload Build Artifact
33
+ uses : actions/upload-artifact@v3
34
+ with :
35
+ name : binaries
36
+ path : ${{ runner.temp }}/artifacts/binaries
37
+
38
+ linux :
39
+ name : Linux
40
+ runs-on : ubuntu-20.04
41
+ needs : build_binaries
42
+
43
+ steps :
44
+ - name : Checkout Code
45
+ uses : actions/checkout@v4
46
+
47
+ - name : Download Build Artifacts
48
+ uses : actions/download-artifact@v3
49
+ with :
50
+ name : binaries
51
+ path : artifacts
52
+
53
+ - name : Run Docker Tests
54
+ run : . run-docker-tests-linux.sh
55
+ shell : bash
56
+
57
+ - name : Build Docker Images
58
+ run : ./build-images-linux.sh
59
+ env :
60
+ DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
61
+ shell : bash
62
+
63
+ windows :
64
+ name : Windows
65
+ runs-on : windows-2022
66
+ needs : build_binaries
67
+
68
+ steps :
69
+ - name : Checkout Code
70
+ uses : actions/checkout@v4
71
+
72
+ - name : Download Build Artifacts
73
+ uses : actions/download-artifact@v3
74
+ with :
75
+ name : binaries
76
+ path : artifacts
77
+
78
+ # Uncomment this step if needed once windows docker tests are implemented
79
+ # - name: Run Docker Tests (Windows)
80
+ # run: .\run-docker-tests-windows.sh
81
+ # shell: bash
82
+
83
+ - name : Build Docker Images
84
+ run : .\build-images-windows.sh
85
+ env :
86
+ DOCKER_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
87
+ shell : bash
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ OUTPUT="type=local,dest=local"
12
12
TAGS=
13
13
TAGS_ALPINE=
14
14
15
- if [[ " ${BUILD_SOURCEBRANCH } " == " refs/heads/master" ]]; then
15
+ if [[ " ${GITHUB_REF } " == " refs/heads/master" ]]; then
16
16
echo " Building and pushing CI images"
17
17
18
18
docker login -u lucaslorentz -p " $DOCKER_PASSWORD "
@@ -22,8 +22,8 @@ if [[ "${BUILD_SOURCEBRANCH}" == "refs/heads/master" ]]; then
22
22
TAGS_ALPINE=" -t lucaslorentz/caddy-docker-proxy:ci-alpine"
23
23
fi
24
24
25
- if [[ " ${BUILD_SOURCEBRANCH } " =~ ^refs/tags/v[0-9]+\. [0-9]+\. [0-9]+ (-.* )? $ ]]; then
26
- RELEASE_VERSION=$( echo $BUILD_SOURCEBRANCH | cut -c11-)
25
+ if [[ " ${GITHUB_REF } " =~ ^refs/tags/v[0-9]+\. [0-9]+\. [0-9]+ (-.* )? $ ]]; then
26
+ RELEASE_VERSION=$( echo $GITHUB_REF | cut -c11-)
27
27
28
28
echo " Releasing version ${RELEASE_VERSION} ..."
29
29
Original file line number Diff line number Diff line change @@ -14,16 +14,16 @@ docker build -f Dockerfile-nanoserver . \
14
14
--build-arg NANOSERVER_VERSION=ltsc2022 \
15
15
-t lucaslorentz/caddy-docker-proxy:ci-nanoserver-ltsc2022
16
16
17
- if [[ " ${BUILD_SOURCEBRANCH } " == " refs/heads/master" ]]; then
17
+ if [[ " ${GITHUB_REF } " == " refs/heads/master" ]]; then
18
18
echo " Pushing CI images"
19
19
20
20
docker login -u lucaslorentz -p " $DOCKER_PASSWORD "
21
21
docker push lucaslorentz/caddy-docker-proxy:ci-nanoserver-1809
22
22
docker push lucaslorentz/caddy-docker-proxy:ci-nanoserver-ltsc2022
23
23
fi
24
24
25
- if [[ " ${BUILD_SOURCEBRANCH } " =~ ^refs/tags/v[0-9]+\. [0-9]+\. [0-9]+ (-.* )? $ ]]; then
26
- RELEASE_VERSION=$( echo $BUILD_SOURCEBRANCH | cut -c11-)
25
+ if [[ " ${GITHUB_REF } " =~ ^refs/tags/v[0-9]+\. [0-9]+\. [0-9]+ (-.* )? $ ]]; then
26
+ RELEASE_VERSION=$( echo $GITHUB_REF | cut -c11-)
27
27
28
28
echo " Releasing version ${RELEASE_VERSION} ..."
29
29
You can’t perform that action at this time.
0 commit comments