Personal-Digital-Asset-Manager/.forgejo/workflows/docker-build.yml
Timothy Rogers d2b8c226d5
Some checks failed
Build and Publish Docker Image / build (push) Failing after 20s
switching to shell since my runner is binary
2025-05-24 11:20:59 -04:00

43 lines
No EOL
1.2 KiB
YAML

name: Build and Publish Docker Image
on:
push:
branches: [ main ]
tags: [ 'v*' ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: docker
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ vars.FORGEJO_REGISTRY }}/${{ vars.FORGEJO_OWNER }}/personal-digital-asset-manager
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha
- name: Login to Container Registry
if: github.event_name != 'pull_request'
shell: bash
run: |
echo "${{ secrets.FORGEJO_TOKEN }}" | docker login ${{ vars.FORGEJO_REGISTRY }} -u ${{ vars.FORGEJO_USER }} --password-stdin
- name: Build and Push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max