Add publish-docker.yml
This commit is contained in:
parent
3b1138d44c
commit
f452fee64a
47
.gitea/workflows/publish-docker.yml
Normal file
47
.gitea/workflows/publish-docker.yml
Normal file
@ -0,0 +1,47 @@
|
||||
name: Publish Docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'OFDLV*'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
name: Build and push Docker image to Gitea Registry
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Extract tag and version
|
||||
id: version
|
||||
run: |
|
||||
TAG="${{ gitea.ref##refs/tags/ }}"
|
||||
VERSION="${TAG#OFDLV}"
|
||||
echo "Tag: $TAG"
|
||||
echo "Version: $VERSION"
|
||||
echo "tag=$TAG" >> "$GITEA_OUTPUT"
|
||||
echo "version=$VERSION" >> "$GITEA_OUTPUT"
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to Gitea Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.ofdl.tools
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: |
|
||||
git.ofdl.tools/sim0n00ps/of-dl:latest
|
||||
git.ofdl.tools/sim0n00ps/of-dl:${{ steps.version.outputs.version }}
|
||||
build-args: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
Loading…
x
Reference in New Issue
Block a user