feat: add github build workflows

This commit is contained in:
Stavros
2025-01-19 16:39:54 +02:00
parent d5041068f9
commit 78bc3e9c9a
6 changed files with 178 additions and 2 deletions

55
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,55 @@
name: Release
on:
workflow_dispatch:
jobs:
get-tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get tag
id: tag
run: echo "name=$(cat internal/assets/version)" >> $GITHUB_OUTPUT
build-docker:
needs: get-tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/arm64, linux/amd64
tags: ghcr.io/${{ github.repository_owner }}/tinyauth:${{ needs.get-tag.outputs.tag }}, ghcr.io/${{ github.repository_owner }}/tinyauth:latest
release:
needs: [get-tag, build-docker]
runs-on: ubuntu-latest
steps:
- name: Create release
uses: softprops/action-gh-release@v2
with:
prerelease: false
make_latest: false
tag_name: ${{ needs.get-tag.outputs.tag }}