Skip to content

Commit 3a543d6

Browse files
committed
GitHub ActionsのDockerイメージワークフローを更新し、マトリックス戦略を追加してバージョン管理を改善
1 parent 3579094 commit 3a543d6

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/docker-image.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
# GitHub では、コミット SHA にアクションをピン留めすることが推奨されます。
77
# 新しいバージョンを取得するには、SHA を更新する必要があります。
88
# タグまたはブランチを参照することもできますが、アクションは警告なしに変更される可能性があります。
9+
permissions:
10+
contents: read
11+
packages: write
912

1013
name: Publish Docker image
1114

@@ -17,6 +20,13 @@ jobs:
1720
push_to_registry:
1821
name: Push Docker image to Docker Hub
1922
runs-on: ubuntu-latest
23+
strategy:
24+
matrix:
25+
include:
26+
- series: innovation
27+
version: "9.2"
28+
- series: lts
29+
version: "8.4"
2030
steps:
2131
- name: Check out the repo
2232
uses: actions/checkout@v4
@@ -32,11 +42,16 @@ jobs:
3242
uses: docker/metadata-action@v5
3343
with:
3444
images: snickerjp/docker-mysql-shell
45+
tags: |
46+
type=semver,pattern={{version}}
47+
type=raw,value=${{ matrix.version }}
48+
type=raw,value=${{ matrix.series }}
49+
type=raw,value=latest,enable=${{ matrix.series == 'lts' }}
3550
3651
- name: Build and push Docker image
37-
uses: docker/build-push-action@v6
52+
uses: docker/build-push-action@v5
3853
with:
39-
context: docker/.
54+
context: ./docker/${{ matrix.series }}
4055
push: true
4156
tags: ${{ steps.meta.outputs.tags }}
4257
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)