mylloon.fr/.forgejo/workflows/publish.yml

48 lines
1.4 KiB
YAML
Raw Permalink Normal View History

2024-08-11 16:49:06 +02:00
name: Publish latest version
on:
2024-08-13 11:55:12 +02:00
workflow_dispatch:
2024-08-11 16:49:06 +02:00
jobs:
build:
container:
image: ghcr.io/catthehacker/ubuntu:act-latest
steps:
2024-08-13 13:01:20 +02:00
- name: Checkout Code
2024-08-11 16:49:06 +02:00
uses: actions/checkout@v4
2024-08-13 13:01:20 +02:00
- name: Checkout LFS
run: |
# Replace double auth header, see https://github.com/actions/checkout/issues/1830
AUTH=$(git config --local http.${{ github.server_url }}/.extraheader)
git config --local --unset http.${{ github.server_url }}/.extraheader
git config --local http.${{ github.server_url }}/${{ github.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH"
2024-08-13 13:01:20 +02:00
# Get files
git lfs fetch
git lfs checkout
2024-08-11 16:49:06 +02:00
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Sanitize metadata
id: meta
uses: docker/metadata-action@v5
with:
tags: latest
images: git.mylloon.fr/${{ github.repository }}
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ${{ github.server_url }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
2024-08-13 13:01:20 +02:00
context: .
2024-08-11 16:49:06 +02:00
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}