52 lines
1.4 KiB
YAML
52 lines
1.4 KiB
YAML
name: Docker Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- develop
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- develop
|
|
|
|
jobs:
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Gitea Container Registry
|
|
if: github.event_name == 'push'
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.forkless.com
|
|
username: ${{ secrets.GITEAUSERNAME }}
|
|
password: ${{ secrets.GITEATOKEN }}
|
|
|
|
- name: Docker metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: gitea.forkless.com/forkless/mermaid-live-editor
|
|
tags: |
|
|
type=raw,value=latest,enable=${{ github.ref_name == 'master' }}
|
|
type=raw,value=nightly,enable=${{ github.ref_name == 'develop' }}
|
|
type=sha,prefix={{branch}}-
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
target: mermaid
|
|
push: ${{ github.event_name == 'push' }}
|
|
pull: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
MERMAID_RENDERER_URL=${{ vars.MERMAID_RENDERER_URL || 'https://mermaid.ink' }}
|
|
MERMAID_KROKI_RENDERER_URL=${{ vars.MERMAID_KROKI_RENDERER_URL || 'https://kroki.io' }}
|