Merge pull request #596 from cybertec-postgresql/dependabot/go_module… #516
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: Update Docker | |
on: | |
push: | |
paths: | |
- '**.go' | |
- '**.yaml' | |
- '**.yml' | |
- 'go.mod' | |
- 'go.sum' | |
- 'Dockerfile' | |
branches: | |
- 'master' | |
workflow_dispatch: | |
jobs: | |
docker: | |
if: true # false to skip job during debug | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Golang | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.20' | |
# despite the fact docker will build binary internally | |
# we want to stop workflow in case of any error before pushing to registry | |
- name: Get dependencies and Build | |
run: | | |
go version | |
go mod download | |
go build | |
- name: Version strings | |
id: version | |
run: | | |
echo "RELEASE_TIME=$(git show -s --format=%cI HEAD)" >> $GITHUB_OUTPUT | |
- name: Publish to Registry | |
uses: elgohr/Publish-Docker-Github-Action@v5 | |
env: | |
VERSION: ${{ github.ref_name }} | |
COMMIT: ${{ github.sha }} | |
DATE: ${{ steps.version.outputs.RELEASE_TIME }} | |
with: | |
name: cybertecpostgresql/pg_timetable | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
buildargs: VERSION,COMMIT,DATE |