mirror of
https://github.com/YuzuZensai/Kiroku.git
synced 2026-01-06 04:33:18 +00:00
Docker build and publish
This commit is contained in:
47
.github/workflows/docker-publish.yaml
vendored
Normal file
47
.github/workflows/docker-publish.yaml
vendored
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
name: Docker Build and Publish
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- '*'
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: ghcr.io/yuzuzensai/kiroku
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Log in to the Container registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ secrets.GHCR_IO_USERNAME }}
|
||||||
|
password: ${{ secrets.GHCR_IO_TOKEN }}
|
||||||
|
|
||||||
|
- name: Docker meta
|
||||||
|
id: docker-meta
|
||||||
|
uses: docker/metadata-action@v3
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ env.IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest,enable=${{ github.ref_type == 'tag' && !contains(github.ref_name, '-') }}
|
||||||
|
type=raw,value=latest-dev,enable=${{ github.ref_type == 'branch' }}
|
||||||
|
type=raw,value=${{ github.ref_name }}
|
||||||
|
type=raw,value=${{ github.sha }},enable=${{ github.ref_type == 'branch' }}
|
||||||
|
flavor: |
|
||||||
|
latest=false
|
||||||
|
|
||||||
|
- name: Docker Build and Push
|
||||||
|
uses: docker/build-push-action@v2
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.docker-meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.docker-meta.outputs.labels }}
|
||||||
Reference in New Issue
Block a user