Skip to content

クラス加入時のニックネーム保存問題修正 #231

クラス加入時のニックネーム保存問題修正

クラス加入時のニックネーム保存問題修正 #231

Workflow file for this run

name: Docker Image CI
on:
pull_request_target:
types: [closed] # プルリクエストがクローズされたときに実行
branches: [main] # main ブランチに対してのみ実行
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, '🆗 safe') && github.event.pull_request.merged == true # 「🆗 safe」 ラベルがあり、マージされたプルリクエストに対してのみ実行
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set up Go environment
uses: actions/setup-go@v3
with:
go-version: 1.22
- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install ko
run: go install github.com/google/ko@latest
- name: Run tests
run: go test ./tests/...
- name: Get the current date
id: date
run: echo "date=$(date +'%Y%m%d%H%M')" >> $GITHUB_ENV
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PASSWORD }}
# - name: Build and push image using ko
# env:
# KO_DOCKER_REPO: ghcr.io/yju-okura/minori_gin
# PATH: $PATH:~/go/bin
# run: |
# ko publish . -B --tags=${{ env.date }},latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
no-cache: true
tags: |
ghcr.io/yju-okura/minori_gin:${{ env.date }}
ghcr.io/yju-okura/minori_gin:latest