Skip to content

Bump gittools/actions from 0.12.0 to 0.13.2 (#85) #104

Bump gittools/actions from 0.12.0 to 0.13.2 (#85)

Bump gittools/actions from 0.12.0 to 0.13.2 (#85) #104

name: Nightly Package Deploy
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.18.1
- name: Check out source code
uses: actions/checkout@v4
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Use GitVersion
id: gitversion # step id used as reference for output values
uses: gittools/actions/gitversion/[email protected]
- name: Build
env:
GOPROXY: "https://proxy.golang.org"
GOOS: linux
GOARCH: amd64
working-directory: src
run: |
go build -v -ldflags="
-w
-s
-X 'main.Version=v${{ steps.gitversion.outputs.SemVer }}'
-X 'app/build.Time=$( date '+%F %H-%M-%S' )'
-X 'github.com/prometheus/common/version.Version=${{ steps.gitversion.outputs.SemVer }}'
-X 'github.com/prometheus/common/version.Revision=${{ steps.gitversion.outputs.VersionSourceSha }}'
-X 'github.com/prometheus/common/version.Branch=${{ steps.gitversion.outputs.BranchName }}'
-X 'github.com/prometheus/common/version.BuildDate=$( date '+%F %H-%M-%S' )'"
- uses: actions/upload-artifact@v4
with:
name: docker_service_exporter.${{ steps.gitversion.outputs.SemVer }}
path: src/docker_service_exporter
- name: Docker Build and push
uses: VaultVulp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
dockerfile: Dockerfile
image-name: server
image-tag: ${{ steps.gitversion.outputs.SemVer }}
custom-args: |
--build-arg APP_VERSION=${{ steps.gitversion.outputs.SemVer }}
--build-arg APP_REVISION=${{ steps.gitversion.outputs.VersionSourceSha }}
--build-arg APP_BRANCH=${{ steps.gitversion.outputs.BranchName }}