Skip to content

Commit 3550d24

Browse files
authored
Merge pull request #12 from devilbox/dependabot/github_actions/cytopia/docker-tag-0.4
Bump cytopia/docker-tag from 0.3 to 0.4
2 parents ebd3651 + 00b4669 commit 3550d24

File tree

5 files changed

+195
-126
lines changed

5 files changed

+195
-126
lines changed

.github/workflows/build.yml

Lines changed: 77 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,60 @@ on:
1313
# Runs on Push
1414
push:
1515

16+
env:
17+
MATRIX_VERSION: '["8.1"]'
18+
MATRIX_ARCH: '["linux/amd64","linux/386","linux/arm64","linux/arm/v7","linux/arm/v6"]'
19+
1620

1721
jobs:
1822

1923
# -----------------------------------------------------------------------------------------------
20-
# Job (1/2): BUILD
24+
# Job (1/3): Configure Pipeline
25+
# -----------------------------------------------------------------------------------------------
26+
configure:
27+
name: Configure
28+
runs-on: ubuntu-latest
29+
outputs:
30+
matrix_version: ${{ steps.set-matrix-version.outputs.matrix_version }}
31+
matrix_arch: ${{ steps.set-matrix-arch.outputs.matrix_arch }}
32+
manifest_arch: ${{ steps.set-manifest-arch.outputs.manifest }}
33+
steps:
34+
35+
- name: "[OUTPUT] Export Matrix 'Version'"
36+
id: set-matrix-version
37+
run: |
38+
echo '::set-output name=matrix_version::${{ env.MATRIX_VERSION }}'
39+
echo "${{ env.MATRIX_VERSION }}"
40+
41+
- name: "[OUTPUT] Export Matrix 'Arch'"
42+
id: set-matrix-arch
43+
run: |
44+
echo '::set-output name=matrix_arch::${{ env.MATRIX_ARCH }}'
45+
echo "${{ env.MATRIX_ARCH }}"
46+
47+
- name: "[OUTPUT] Export Manifest 'Arch'"
48+
id: set-manifest-arch
49+
run: |
50+
ARCH="$( echo ${{ env.MATRIX_ARCH }} | sed 's/"//g' | sed 's/\[//g' | sed 's/\]//g' | sed 's/ //g' )"
51+
echo "::set-output name=manifest::${ARCH}"
52+
echo "${ARCH}"
53+
54+
55+
# -----------------------------------------------------------------------------------------------
56+
# Job (2/3): BUILD
2157
# -----------------------------------------------------------------------------------------------
2258
build:
23-
name: "[ PHP-${{ matrix.version }} (${{ matrix.arch }}) ]"
59+
needs: configure
60+
name: Build PHP-${{ matrix.version }} (${{ matrix.arch }})
2461
runs-on: ubuntu-latest
2562
strategy:
2663
fail-fast: false
2764
matrix:
2865
version:
29-
- '8.1'
66+
- ${{ fromJson(needs.configure.outputs.matrix_version) }}
3067
arch:
31-
- 'linux/amd64'
32-
- 'linux/arm64'
33-
- 'linux/386'
34-
- 'linux/arm/v7'
35-
- 'linux/arm/v6'
68+
- ${{ fromJson(needs.configure.outputs.matrix_arch) }}
3669
steps:
37-
3870
# ------------------------------------------------------------
3971
# Setup repository
4072
# ------------------------------------------------------------
@@ -51,37 +83,31 @@ jobs:
5183

5284
- name: "[SETUP] Determine Docker tag"
5385
id: tag
54-
uses: cytopia/docker-tag@v0.3
86+
uses: cytopia/docker-tag-action@v0.4.7
5587

5688
# ------------------------------------------------------------
5789
# Build
5890
# ------------------------------------------------------------
5991
- name: Build
60-
uses: cytopia/[email protected]
92+
uses: cytopia/[email protected].2
6193
with:
6294
command: |
63-
make build ARCH=${ARCH}
64-
env:
65-
ARCH: ${{ matrix.arch }}
95+
make build ARCH=${{ matrix.arch }}
6696
6797
# ------------------------------------------------------------
6898
# Test
6999
# ------------------------------------------------------------
70100
- name: "[TEST] Docker Image"
71-
uses: cytopia/[email protected]
101+
uses: cytopia/[email protected].2
72102
with:
73103
command: |
74-
make test ARCH=${ARCH}
75-
env:
76-
ARCH: ${{ matrix.arch }}
104+
make test ARCH=${{ matrix.arch }}
77105
78106
- name: "[TEST] Update README"
79-
uses: cytopia/[email protected]
107+
uses: cytopia/[email protected].2
80108
with:
81109
command: |
82-
make update-readme ARCH=${ARCH}
83-
env:
84-
ARCH: ${{ matrix.arch }}
110+
make update-readme ARCH=${{ matrix.arch }}
85111
86112
- name: "[TEST] Verify README"
87113
run: |
@@ -90,19 +116,26 @@ jobs:
90116
# ------------------------------------------------------------
91117
# Deploy
92118
# ------------------------------------------------------------
93-
- name: "[DEPLOY] Login"
119+
- name: "[DEPLOY] Login (only repo owner)"
94120
uses: docker/login-action@v1
95121
with:
96122
username: ${{ secrets.DOCKERHUB_USERNAME }}
97123
password: ${{ secrets.DOCKERHUB_PASSWORD }}
124+
# https://help.github.com/en/github/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#functions
125+
if: github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id
126+
&& (
127+
(github.event_name == 'schedule' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')))
128+
||
129+
(github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')))
130+
||
131+
(github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release-'))
132+
)
98133

99134
- name: "[DEPLOY] Publish architecture image (only repo owner)"
100-
uses: cytopia/[email protected]
135+
uses: cytopia/[email protected].2
101136
with:
102137
command: |
103-
make push-arch TAG=${{ steps.tag.outputs.docker-tag }} ARCH=${ARCH}
104-
env:
105-
ARCH: ${{ matrix.arch }}
138+
make push-arch TAG=${{ steps.tag.outputs.docker-tag }} ARCH=${{ matrix.arch }}
106139
# https://help.github.com/en/github/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#functions
107140
if: github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id
108141
&& (
@@ -114,19 +147,27 @@ jobs:
114147
)
115148

116149
# -----------------------------------------------------------------------------------------------
117-
# Job (2/2): DEPLOY
150+
# Job (3/3): DEPLOY
118151
# -----------------------------------------------------------------------------------------------
119152
deploy:
120-
needs: [build]
153+
needs: [configure, build]
121154
name: Deploy
122155
runs-on: ubuntu-latest
123156
strategy:
124157
fail-fast: false
125158
matrix:
126159
version:
127-
- '8.1'
160+
- ${{ fromJson(needs.configure.outputs.matrix_version) }}
161+
# https://help.github.com/en/github/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#functions
162+
if: github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id
163+
&& (
164+
(github.event_name == 'schedule' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')))
165+
||
166+
(github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')))
167+
||
168+
(github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release-'))
169+
)
128170
steps:
129-
130171
# ------------------------------------------------------------
131172
# Setup repository
132173
# ------------------------------------------------------------
@@ -137,7 +178,7 @@ jobs:
137178

138179
- name: "[SETUP] Determine Docker tag"
139180
id: tag
140-
uses: cytopia/docker-tag@v0.3
181+
uses: cytopia/docker-tag-action@v0.4.7
141182

142183
# ------------------------------------------------------------
143184
# Deploy
@@ -149,22 +190,13 @@ jobs:
149190
password: ${{ secrets.DOCKERHUB_PASSWORD }}
150191

151192
- name: "[DEPLOY] Create Docker manifest"
152-
uses: cytopia/[email protected]
193+
uses: cytopia/[email protected].2
153194
with:
154195
command: |
155-
make manifest-create TAG=${{ steps.tag.outputs.docker-tag }} ARCH="linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6"
196+
make manifest-create TAG=${{ steps.tag.outputs.docker-tag }} ARCH="${{ needs.configure.outputs.manifest_arch }}"
156197
157-
- name: "[DEPLOY] Publish Docker manifest (only repo owner)"
158-
uses: cytopia/[email protected]
198+
- name: "[DEPLOY] Publish Docker manifest"
199+
uses: cytopia/[email protected].2
159200
with:
160201
command: |
161202
make manifest-push TAG=${{ steps.tag.outputs.docker-tag }}
162-
# https://help.github.com/en/github/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#functions
163-
if: github.event.pull_request.base.repo.id == github.event.pull_request.head.repo.id
164-
&& (
165-
(github.event_name == 'schedule' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')))
166-
||
167-
(github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')))
168-
||
169-
(github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release-'))
170-
)

.github/workflows/contributor.yml

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,30 +13,64 @@ on:
1313
# Runs on Pull Requests
1414
pull_request:
1515

16+
env:
17+
MATRIX_VERSION: '["8.1"]'
18+
MATRIX_ARCH: '["linux/amd64","linux/386","linux/arm64","linux/arm/v7","linux/arm/v6"]'
19+
1620

1721
jobs:
1822

1923
# -----------------------------------------------------------------------------------------------
20-
# Job (1/2): BUILD
24+
# Job (1/3): Configure Pipeline
25+
# -----------------------------------------------------------------------------------------------
26+
configure:
27+
name: Configure
28+
runs-on: ubuntu-latest
29+
outputs:
30+
matrix_version: ${{ steps.set-matrix-version.outputs.matrix_version }}
31+
matrix_arch: ${{ steps.set-matrix-arch.outputs.matrix_arch }}
32+
manifest_arch: ${{ steps.set-manifest-arch.outputs.manifest }}
33+
# Only run for forks (contributor)
34+
if: ${{ github.event.pull_request.head.repo.fork }}
35+
steps:
36+
37+
- name: "[OUTPUT] Export Matrix 'Version'"
38+
id: set-matrix-version
39+
run: |
40+
echo '::set-output name=matrix_version::${{ env.MATRIX_VERSION }}'
41+
echo "${{ env.MATRIX_VERSION }}"
42+
43+
- name: "[OUTPUT] Export Matrix 'Arch'"
44+
id: set-matrix-arch
45+
run: |
46+
echo '::set-output name=matrix_arch::${{ env.MATRIX_ARCH }}'
47+
echo "${{ env.MATRIX_ARCH }}"
48+
49+
- name: "[OUTPUT] Export Manifest 'Arch'"
50+
id: set-manifest-arch
51+
run: |
52+
ARCH="$( echo ${{ env.MATRIX_ARCH }} | sed 's/"//g' | sed 's/\[//g' | sed 's/\]//g' | sed 's/ //g' )"
53+
echo "::set-output name=manifest::${ARCH}"
54+
echo "${ARCH}"
55+
56+
57+
# -----------------------------------------------------------------------------------------------
58+
# Job (2/3): BUILD
2159
# -----------------------------------------------------------------------------------------------
2260
build:
23-
name: "[ PHP-${{ matrix.version }} (${{ matrix.arch }}) ]"
61+
needs: configure
62+
name: Build PHP-${{ matrix.version }} (${{ matrix.arch }})
2463
runs-on: ubuntu-latest
2564
strategy:
2665
fail-fast: false
2766
matrix:
2867
version:
29-
- '8.1'
68+
- ${{ fromJson(needs.configure.outputs.matrix_version) }}
3069
arch:
31-
- 'linux/amd64'
32-
- 'linux/arm64'
33-
- 'linux/386'
34-
- 'linux/arm/v7'
35-
- 'linux/arm/v6'
70+
- ${{ fromJson(needs.configure.outputs.matrix_arch) }}
3671
# Only run for forks (contributor)
3772
if: ${{ github.event.pull_request.head.repo.fork }}
3873
steps:
39-
4074
# ------------------------------------------------------------
4175
# Setup repository
4276
# ------------------------------------------------------------
@@ -53,37 +87,31 @@ jobs:
5387

5488
- name: "[SETUP] Determine Docker tag"
5589
id: tag
56-
uses: cytopia/docker-tag@v0.3
90+
uses: cytopia/docker-tag-action@v0.4.7
5791

5892
# ------------------------------------------------------------
5993
# Build
6094
# ------------------------------------------------------------
6195
- name: Build
62-
uses: cytopia/[email protected]
96+
uses: cytopia/[email protected].2
6397
with:
6498
command: |
65-
make build ARCH=${ARCH}
66-
env:
67-
ARCH: ${{ matrix.arch }}
99+
make build ARCH=${{ matrix.arch }}
68100
69101
# ------------------------------------------------------------
70102
# Test
71103
# ------------------------------------------------------------
72104
- name: "[TEST] Docker Image"
73-
uses: cytopia/[email protected]
105+
uses: cytopia/[email protected].2
74106
with:
75107
command: |
76-
make test ARCH=${ARCH}
77-
env:
78-
ARCH: ${{ matrix.arch }}
108+
make test ARCH=${{ matrix.arch }}
79109
80110
- name: "[TEST] Update README"
81-
uses: cytopia/[email protected]
111+
uses: cytopia/[email protected].2
82112
with:
83113
command: |
84-
make update-readme ARCH=${ARCH}
85-
env:
86-
ARCH: ${{ matrix.arch }}
114+
make update-readme ARCH=${{ matrix.arch }}
87115
88116
- name: "[TEST] Verify README"
89117
run: |

.github/workflows/lint.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
lint:
2222
name: "Lint"
2323
runs-on: ubuntu-latest
24+
if: github.actor != 'dependabot[bot]'
2425
steps:
2526
# ------------------------------------------------------------
2627
# Setup repository
@@ -30,10 +31,13 @@ jobs:
3031
with:
3132
fetch-depth: 0
3233

34+
- name: Output info
35+
run: |
36+
echo "${{ github.actor }}"
37+
3338
# ------------------------------------------------------------
3439
# Lint repository
3540
# ------------------------------------------------------------
3641
- name: Lint workflow
37-
id: vars
3842
run: |
3943
make lint-workflow

0 commit comments

Comments
 (0)