build(deps): bump the go_modules group across 1 directory with 7 updates #508
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: Daemon | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "master" | |
| paths: | |
| - "daemon/**" | |
| - ".github/workflows/daemon.yaml" | |
| tags: | |
| - "40swapd/*" | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - "daemon/**" | |
| - ".github/workflows/daemon.yaml" | |
| concurrency: | |
| # Cancel any previous workflows if they are from a PR or push. | |
| group: ${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| REGISTRY: ghcr.io | |
| BASE_BUILDER_IMAGE: golang:1.24.1-alpine | |
| BASE_RUNNER_IMAGE: alpine:latest | |
| jobs: | |
| go-lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'daemon/go.mod' | |
| cache-dependency-path: | | |
| daemon/go.sum | |
| daemon/go.mod | |
| - name: golangci-lint | |
| uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6 | |
| with: | |
| working-directory: daemon | |
| args: "--timeout=10m" | |
| go-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: 'daemon/go.mod' | |
| cache-dependency-path: | | |
| daemon/go.sum | |
| daemon/go.mod | |
| - name: Run Tests | |
| working-directory: daemon | |
| run: go test ./... | |
| build-docker: | |
| # Run this only when we are merging to :master or a new tag is created. | |
| if: | | |
| github.ref == 'refs/heads/master' || | |
| startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| # needs: | |
| # - go-lint | |
| # - go-test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Subtract '40swapd/' from tag name | |
| id: clean_tag_name | |
| run: | | |
| echo "CLEAN_TAG_NAME=${GITHUB_REF_NAME##40swapd\/}" >> $GITHUB_OUTPUT | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Log into the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ github.repository }}/40swapd | |
| labels: | | |
| commit=${{ github.sha }} | |
| actions_run=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| tags: | | |
| type=schedule | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,event=tag,pattern={{version}},value=${{ steps.clean_tag_name.outputs.CLEAN_TAG_NAME }} | |
| - name: Build and push the Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: daemon | |
| file: daemon/docker/Dockerfile | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| provenance: false | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| BASE_BUILDER_IMAGE=${{ env.BASE_BUILDER_IMAGE }} | |
| BASE_RUNNER_IMAGE=${{ env.BASE_RUNNER_IMAGE }} | |
| secrets: | | |
| github_token=${{ secrets.GITHUB_TOKEN }} |