コンテナイメージ公開CIを追加
Validate and publish container image / build (pull_request) Failing after 1m31s

This commit is contained in:
2026-07-18 08:42:04 +09:00
parent 8fe18971f0
commit c14716c46b
9 changed files with 202 additions and 28 deletions
+54
View File
@@ -0,0 +1,54 @@
name: Validate and publish container image
on:
pull_request:
branches:
- main
push:
branches:
- main
env:
REGISTRY: harbor.mukan.0am.jp
IMAGE_NAME: harbor.mukan.0am.jp/services/email-to-discord
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Build test stage
run: |
docker build \
--target test \
--tag "${IMAGE_NAME}:test-${{ gitea.sha }}" \
.
- name: Build runtime image
run: |
docker build \
--target runtime \
--tag "${IMAGE_NAME}:${{ gitea.sha }}" \
--tag "${IMAGE_NAME}:latest" \
.
- name: Log in to Harbor
if: gitea.event_name == 'push'
env:
HARBOR_USERNAME: ${{ secrets.HARBOR_USERNAME }}
HARBOR_PASSWORD: ${{ secrets.HARBOR_PASSWORD }}
run: |
printf '%s' "${HARBOR_PASSWORD}" | docker login "${REGISTRY}" \
--username "${HARBOR_USERNAME}" \
--password-stdin
- name: Push runtime image
if: gitea.event_name == 'push'
run: |
docker push "${IMAGE_NAME}:${{ gitea.sha }}"
docker push "${IMAGE_NAME}:latest"