name: ci on: push: workflow_dispatch: jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: "1.23" - run: go vet ./... - run: go test -race ./... - name: golangci-lint run: | if command -v golangci-lint >/dev/null 2>&1; then golangci-lint run else echo "golangci-lint not available in runner image, skipping" fi docker: needs: test runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Compute image tags and version id: meta run: | SHORT=$(echo "${{ gitea.sha }}" | cut -c1-7) REPO=git.rambossek.at/${{ gitea.repository }} TAGS="$REPO:sha-$SHORT" VERSION="sha-$SHORT" if [ "${{ gitea.ref_type }}" = "branch" ] && [ "${{ gitea.ref_name }}" = "main" ]; then TAGS="$TAGS,$REPO:latest" fi if [ "${{ gitea.ref_type }}" = "tag" ]; then TAGS="$TAGS,$REPO:${{ gitea.ref_name }}" VERSION="${{ gitea.ref_name }}" fi echo "tags=$TAGS" >> "$GITHUB_OUTPUT" echo "version=$VERSION" >> "$GITHUB_OUTPUT" - uses: docker/setup-buildx-action@v3 - uses: docker/login-action@v3 with: registry: git.rambossek.at username: ${{ gitea.actor }} password: ${{ secrets.GITEA_TOKEN }} - uses: docker/build-push-action@v6 with: context: . push: true build-args: | VERSION=${{ steps.meta.outputs.version }} tags: ${{ steps.meta.outputs.tags }}