build(deps): bump the all-go group across 1 directory with 7 updates #48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: GitHub Bot Image | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [main, master] | |
| paths: | |
| - "services/github-bot/**" | |
| - "services/control-plane/gen/**" | |
| - ".github/workflows/github-bot.yaml" | |
| pull_request: | |
| branches: [main, master] | |
| paths: | |
| - "services/github-bot/**" | |
| - "services/control-plane/gen/**" | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository_owner }}/netclode-github-bot | |
| jobs: | |
| test-and-build: | |
| name: Test & Build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| env: | |
| DD_API_KEY: ${{ secrets.DD_API_KEY }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| # --- Test --- | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: services/github-bot/go.mod | |
| cache-dependency-path: services/github-bot/go.sum | |
| - name: Run tests | |
| working-directory: services/github-bot | |
| run: | | |
| go install gotest.tools/gotestsum@v1.13.0 | |
| gotestsum --junitfile test-results.xml -- ./... | |
| - name: Upload test results to Datadog | |
| if: always() && env.DD_API_KEY != '' | |
| working-directory: services/github-bot | |
| run: | | |
| npx @datadog/datadog-ci@2.48 junit upload --service github-bot test-results.xml | |
| env: | |
| DATADOG_SITE: datadoghq.com | |
| # --- Build --- | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Container Registry | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=sha,prefix= | |
| type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: services/github-bot/Dockerfile | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |