name: Release on: push: tags: - "v*" workflow_dispatch: inputs: version: description: "Version to release (e.g., v1.0.0)" required: true type: string jobs: release: runs-on: [ubuntu-latest] steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to Gitea Container Registry uses: docker/login-action@v3 with: registry: git.allucanget.biz username: ${{ secrets.CI_REGISTRY_USER }} password: ${{ secrets.CI_REGISTRY_TOKEN }} - name: Extract version id: version run: | if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT else echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT fi - name: Extract metadata for Playout id: meta-playout uses: docker/metadata-action@v5 with: images: git.allucanget.biz/zwitschi/linearvoid/playout tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=raw,value=latest - name: Build and push Playout image uses: docker/build-push-action@v5 with: context: ./backend/playout push: true tags: ${{ steps.meta-playout.outputs.tags }} labels: ${{ steps.meta-playout.outputs.labels }} - name: Extract metadata for Chat id: meta-chat uses: docker/metadata-action@v5 with: images: git.allucanget.biz/zwitschi/linearvoid/chat tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=raw,value=latest - name: Build and push Chat image uses: docker/build-push-action@v5 with: context: ./backend/chat push: true tags: ${{ steps.meta-chat.outputs.tags }} labels: ${{ steps.meta-chat.outputs.labels }} - name: Extract metadata for Nginx id: meta-nginx uses: docker/metadata-action@v5 with: images: git.allucanget.biz/zwitschi/linearvoid/nginx tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=raw,value=latest - name: Build and push Nginx image uses: docker/build-push-action@v5 with: context: . file: infrastructure/nginx/Dockerfile push: true tags: ${{ steps.meta-nginx.outputs.tags }} labels: ${{ steps.meta-nginx.outputs.labels }} - name: Create Release on Gitea run: | curl -X POST "$CI_SERVER_URL/api/v1/repos/$CI_REPO_OWNER/$CI_REPO_NAME/releases" \ -H "Authorization: token ${{ secrets.CI_REGISTRY_TOKEN }}" \ -H "Content-Type: application/json" \ -d "{\"tag_name\":\"${{ steps.version.outputs.version }}\",\"name\":\"${{ steps.version.outputs.version }}\",\"body\":\"Release ${{ steps.version.outputs.version }}\n\nSee [CHANGELOG.md](https://git.allucanget.biz/zwitschi/linearvoid/src/branch/main/CHANGELOG.md) for details.\",\"draft\":false,\"prerelease\":false}"