Skip to content

Commit

Permalink
Merge pull request #529 from cybertec-postgresql/528-add-PR-docker-gh…
Browse files Browse the repository at this point in the history
…a-workflow

[+]  add GHA workflow to build Docker image for each PR, closes #528
  • Loading branch information
pashagolub committed Nov 21, 2022
2 parents 1136f34 + 986d39e commit 5d72e26
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build & Test
on:
pull_request:
workflow_dispatch:

jobs:

test-docker-images:
if: true # false to skip job during debug
name: Test Docker Image on Ubuntu
runs-on: ubuntu-latest
steps:

- name: Check out code
uses: actions/checkout@v3

- name: Version strings
id: version
run: |
echo "PR_VERSION=$(echo "$GITHUB_REF_NAME#${GITHUB_SHA:0:6}")" >> $GITHUB_OUTPUT
echo "PR_TIME=$(git show -s --format=%cI HEAD)" >> $GITHUB_OUTPUT
echo "PR_TAGNAME"=$(echo $GITHUB_REF_NAME | tr // _) >> $GITHUB_OUTPUT
- name: Publish test version to Registry
uses: elgohr/Publish-Docker-Github-Action@v4
env:
GIT_HASH: ${{ steps.version.outputs.PR_VERSION }}
GIT_TIME: ${{ steps.version.outputs.PR_TIME }}
TAG_NAME: ${{ steps.version.outputs.PR_TAGNAME }}
with:
name: cybertec/pgwatch2-postgres
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: docker/Dockerfile-postgres
buildargs: GIT_HASH,GIT_TIME
tags: ${{ steps.version.outputs.PR_TAGNAME }}

0 comments on commit 5d72e26

Please sign in to comment.