--- name: CI/CD on: workflow_dispatch: {} push: branches: - main paths-ignore: - 'README.md' - 'AUTH.md' - 'DEPLOY.md' - 'HOWTO_ADD_BOT.md' - 'chart/**' - '.gitignore' - 'Makefile' - 'bots.example.yaml' - 'docker-compose.yml' pull_request: branches: - main paths-ignore: - 'README.md' - 'AUTH.md' - 'DEPLOY.md' - 'HOWTO_ADD_BOT.md' - 'chart/**' - '.gitignore' - 'docker-compose.yml' concurrency: group: ${{ github.ref }}-${{ github.workflow }} cancel-in-progress: true jobs: test: runs-on: ubuntu-latest steps: - name: git checkout uses: actions/checkout@v4 - name: setup go uses: actions/setup-go@v5 with: go-version: '1.24' cache: true - name: go vet run: go vet ./... - name: go test (race + count=1) run: go test -race -count=1 -timeout 120s ./... build-and-push-image: runs-on: ubuntu-latest needs: test if: github.event_name == 'push' && github.ref == 'refs/heads/main' steps: - name: Login to Gitea Container Registry uses: docker/login-action@v3 with: registry: gitea.arcodange.lab username: ${{ github.actor }} password: ${{ secrets.PACKAGES_TOKEN }} - name: git checkout uses: actions/checkout@v4 - name: Build and push image to Gitea Container Registry run: |- TAGS="latest ${{ github.ref_name }}" docker build -t app . for TAG in $TAGS; do docker tag app gitea.arcodange.lab/${{ github.repository }}:$TAG docker push gitea.arcodange.lab/${{ github.repository }}:$TAG done