Merge pull request #347 from compscidr/jason/settings #234
This file contains 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: Untagged workflow | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set up Go 1.23.2 | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23.2 | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Get tag information | |
id: checkout | |
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | |
- name: Get dependencies | |
run: | | |
go get -v -t -d ./... | |
if [ -f Gopkg.toml ]; then | |
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh | |
dep ensure | |
fi | |
- name: Build | |
run: go build -ldflags="-X 'main.Version=latest'" -v . | |
- name: Test | |
run: go test -race -coverprofile=coverage.txt -covermode=atomic goblog/... | |
- name: Code Coverage | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Dockerhub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# https://github.com/marketplace/actions/build-and-push-docker-images#Example-usage | |
- name: Build and push tag | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
build-args: | | |
VERSION=${{ steps.checkout.outputs.tag }} | |
tags: compscidr/goblog:${{ steps.checkout.outputs.tag }} |