86 lines
2.7 KiB
YAML
86 lines
2.7 KiB
YAML
name: Container Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
- '0.*'
|
|
- '1.*'
|
|
|
|
env:
|
|
REGISTRY: git.sschuhmann.de
|
|
REPOSITORY: sschuhmann/rehearsalhub
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Gitea Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ secrets.GITEA_USER }}
|
|
password: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Extract metadata (tags, labels) for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}
|
|
tags: |
|
|
type=ref,event=tag
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
|
|
- name: Build and push API container
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./api
|
|
file: ./api/Dockerfile
|
|
push: true
|
|
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/api:${{ github.ref_name }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
- name: Build and push Web container
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./web
|
|
file: ./web/Dockerfile
|
|
push: true
|
|
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/web:${{ github.ref_name }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
- name: Build and push Worker container
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./worker
|
|
file: ./worker/Dockerfile
|
|
push: true
|
|
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/worker:${{ github.ref_name }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
- name: Build and push Watcher container
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./watcher
|
|
file: ./watcher/Dockerfile
|
|
push: true
|
|
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/watcher:${{ github.ref_name }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
|
|
- name: Summary
|
|
run: |
|
|
echo "✅ Container release complete!"
|
|
echo ""
|
|
echo "Pushed images:"
|
|
echo " - ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/api:${{ github.ref_name }}"
|
|
echo " - ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/web:${{ github.ref_name }}"
|
|
echo " - ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/worker:${{ github.ref_name }}"
|
|
echo " - ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/watcher:${{ github.ref_name }}" |