Update dependencies #63
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: CI/CD | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup Go environment | |
| uses: actions/setup-go@v2.1.4 | |
| - uses: actions/cache@v2 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Get tooling | |
| run: | | |
| go get golang.org/x/lint | |
| go get honnef.co/go/tools/cmd/staticcheck | |
| - name: build | |
| run: go build -v -tags=gofuzz ./... | |
| - name: vet | |
| run: go vet ./... | |
| continue-on-error: true | |
| - name: staticcheck | |
| run: ~/go/bin/staticcheck ./... | |
| continue-on-error: true | |
| - name: lint | |
| run: ~/go/bin/golint -set_exit_status ./... | |
| continue-on-error: true | |
| - name: Go Test | |
| run: go test -v -race ./... | |
| build-and-publish-docker-image: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v1 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push docker image | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64/v8 | |
| push: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
| tags: ghcr.io/projectlighthousecau/beacon:latest | |
| cache-from: type=registry,ref=ghcr.io/projectlighthousecau/beacon:latest | |
| cache-to: type=inline |