-
-
Notifications
You must be signed in to change notification settings - Fork 134
188 lines (182 loc) · 5.61 KB
/
ci.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
name: CI
on:
push:
branches:
- "20.10"
tags:
- "*"
pull_request:
workflow_dispatch:
jobs:
skip:
runs-on: ubuntu-latest
if: |
(! (contains( github.event.head_commit.message, '[skip ci]')
|| contains( github.event.head_commit.message, '[skip action]')
|| contains( github.event.head_commit.message, '[skip actions]')
|| contains( github.event.head_commit.message, '[ci skip]')
|| contains( github.event.head_commit.message, '[actions skip]')
|| contains( github.event.head_commit.message, '[action skip]')))
steps:
- run: echo "build continue !"
ci:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-12
needs: skip
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash --noprofile --norc -exo pipefail {0}
steps:
- uses: actions/checkout@main
with:
fetch-depth: 2
- uses: docker-practice/actions-setup-docker@master
with:
docker_channel: test
docker_version: "20.10"
- uses: azure/docker-login@v1
if: |
github.event_name == 'push'
&& startsWith(matrix.os, 'ubuntu' )
with:
# login-server: contoso.azurecr.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- uses: azure/docker-login@v1
if: |
github.event_name == 'push'
&& startsWith(matrix.os, 'ubuntu' )
with:
login-server: ghcr.io
username: khs1994
password: ${{ secrets.GHCR_IO_TOKEN }}
- uses: azure/docker-login@v1
if: |
github.event_name == 'push'
&& startsWith(matrix.os, 'ubuntu' )
with:
login-server: pcit-docker.pkg.coding.net
username: khs1994-1601432822176
password: ${{secrets.CODING_DOCKER_PASSWORD}}
- name: Stop MySQL
run: sudo systemctl stop mysql
if: |
startsWith(matrix.os, 'ubuntu' )
- name: Test
run: |
QUITE=true ./lnmp-docker test development
# command -v docker-compose
# sudo rm -rf $(command -v docker-compose) || true
# export LNMP_SERVICES="nginx mariadb php8 redis"
# export LREW_INCLUDE="mariadb"
if: |
startsWith(matrix.os, 'ubuntu' )
- name: Up
run: |
./lnmp-docker config > docker-compose.yml
docker compose config -q
docker compose up -d $(./lnmp-docker services)
sleep 20
docker ps -a
curl -fsSL 127.0.0.1
quite=true ./lnmp-docker down
./lnmp-docker up
- name: Connect
run: |
sleep 20
curl -fsSL 127.0.0.1
- name: Down
run: ./lnmp-docker down
- name: Test Swarm mode
run: |
QUITE=true ./lnmp-docker test swarm
if: |
startsWith(matrix.os, 'ubuntu' )
- shell: pwsh
run: ./lnmp-docker.ps1
- name: Set ENV
run: |
echo "$(pwd)" >> $GITHUB_PATH
echo "$(pwd)/bin" >> $GITHUB_PATH
#echo "LNMP_PATH=$(pwd)" >> $GITHUB_ENV
- name: lnmp-CLI
run: |
sleep 10
lnmp-php -v
lnmp-composer --version
lnmp-npm -v
lnmp-yarn -v
- name: build and push [ lwpm ] image
if: |
contains( github.event.head_commit.message, '[lwpm]' )
&& github.event_name == 'push'
&& startsWith(matrix.os, 'ubuntu' )
run: |
docker buildx build -t lwpm/lwpm \
-t ghcr.io/khs1994/lwpm \
-t pcit-docker.pkg.coding.net/khs1994-docker/lwpm/lwpm \
-f windows/lwpm.Dockerfile --push windows
- name: build and push [ docker-image-sync ] image
if: |
contains( github.event.head_commit.message, '[lwpm]' )
&& github.event_name == 'push'
&& startsWith(matrix.os, 'ubuntu' )
run: |
docker buildx build -t khs1994/docker-image-sync \
-t ghcr.io/khs1994/docker-image-sync \
-t pcit-docker.pkg.coding.net/khs1994-docker/khs1994/docker-image-sync \
-f windows/docker-image-sync.Dockerfile --push windows
- name: build and push [ lrew ] image
if: |
contains( github.event.head_commit.message, '[lrew]' )
&& github.event_name == 'push'
&& startsWith(matrix.os, 'ubuntu' )
run: |
docker buildx build -t lrew/lrew \
-t ghcr.io/lrew/lrew \
-t pcit-docker.pkg.coding.net/khs1994-docker/lrew/lrew \
--push lrew
- name: Config git
run: |
git config --global user.email "[email protected]"
git config --global user.name "gh-bot"
- name: rm lnmp
run: |
cd ..
sudo rm -rf lnmp
mkdir lnmp
- uses: actions/checkout@main
with:
fetch-depth: 2
- name: Check config
run: |
sudo apt install -y tree
cd config
./default.sh
tree .
cd ..
git status | grep "nothing to commit" && exit 0 || true
git add .
git commit -m "[Config] Update default config" || exit 0
git remote add github https://khs1994:${GITHUB_TOKEN}@github.com/khs1994-docker/lnmp.git
git checkout -b 20.10-config
git push github 20.10-config -f
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
if: |
startsWith(matrix.os, 'ubuntu' )
powershell:
needs: skip
runs-on: windows-latest
steps:
- uses: actions/checkout@main
with:
fetch-depth: 2
- shell: powershell
run: |
./lnmp-docker.ps1