added release gitea action
This commit is contained in:
parent
5486c25603
commit
c02a716ecc
1 changed files with 43 additions and 0 deletions
43
.gitea/workflows/release.yml
Normal file
43
.gitea/workflows/release.yml
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
name: Build and Push Release Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-push-release:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Gitea Container Registry
|
||||
run: |
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.avatic.de -u "${{ gitea.actor }}" --password-stdin
|
||||
|
||||
- name: Extract version from tag
|
||||
id: version
|
||||
run: |
|
||||
if [ "${{ gitea.ref_type }}" == "tag" ]; then
|
||||
echo "version=${{ gitea.ref_name }}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "version=manual-$(date +%Y%m%d-%H%M%S)" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build Docker image
|
||||
run: |
|
||||
docker build \
|
||||
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
||||
-t git.avatic.de/${{ gitea.repository_owner }}/lcc-release:${{ steps.version.outputs.version }} \
|
||||
-t git.avatic.de/${{ gitea.repository_owner }}/lcc-release:latest \
|
||||
-t git.avatic.de/${{ gitea.repository_owner }}/lcc:latest \
|
||||
.
|
||||
|
||||
- name: Push Docker images
|
||||
run: |
|
||||
docker push git.avatic.de/${{ gitea.repository_owner }}/lcc-release:${{ steps.version.outputs.version }}
|
||||
docker push git.avatic.de/${{ gitea.repository_owner }}/lcc-release:latest
|
||||
docker push git.avatic.de/${{ gitea.repository_owner }}/lcc:latest
|
||||
Loading…
Add table
Reference in a new issue