name: Build and Push Container Image on: push: branches: - main tags: - "v*" jobs: build-and-push: runs-on: orchestration-platform steps: - name: Checkout code uses: actions/checkout@v4 - name: Determine image tag id: meta run: | if echo "${{ gitea.ref }}" | grep -q "refs/tags/"; then TAG=$(echo "${{ gitea.ref }}" | sed 's|refs/tags/||') else TAG="latest" fi echo "tag=${TAG}" >> "$GITHUB_OUTPUT" - name: Login to Gitea registry run: | echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ gitea.server_url }} -u ${{ gitea.actor }} --password-stdin - name: Build and push image run: | IMAGE="${{ gitea.server_url }}/${{ gitea.repository }}:${{ steps.meta.outputs.tag }}" docker build -t "${IMAGE}" . docker push "${IMAGE}"