chore: build docker image automatically (#604)

* chore: build docker image automatically

* chore: add semver tag

* fix: get tag from release
This commit is contained in:
Eunwoo Choi 2023-06-30 13:26:08 +09:00 committed by GitHub
parent 04255b52d9
commit ef7ea1bed7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,7 @@
name: Publish Stable
on:
workflow_dispatch:
release:
types: [published]
env:
REGISTRY: ghcr.io
@ -27,7 +28,7 @@ jobs:
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get metadata for Docker
uses: docker/metadata-action@v4
@ -37,7 +38,8 @@ jobs:
tags: |
type=raw,value=latest,priority=100
type=raw,value=stable,priority=200
type=sha,prefix=,suffix=,format=short,priority=300
type=semver,pattern={{version}},value=$GITHUB_REF_NAME,priority=300
type=sha,prefix=,suffix=,format=short,priority=400
type=schedule,pattern={{date 'YYYYMMDD-hhmmss' tz='Asia/Seoul'}}
- name: Build and push
uses: docker/build-push-action@v4

View File

@ -1,6 +1,7 @@
name: Publish
on:
workflow_dispatch:
push:
branches: [master]
env:
REGISTRY: ghcr.io
@ -27,7 +28,7 @@ jobs:
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get metadata for Docker
uses: docker/metadata-action@v4