Skip to content

Commit

Permalink
[+] add GHA workflow to build Docker image for each PR, closes #528
Browse files Browse the repository at this point in the history
  • Loading branch information
pashagolub committed Nov 21, 2022
1 parent 1136f34 commit f5d616b
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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 "RELEASE_VERSION=$(echo "$GITHUB_REF_NAME#${GITHUB_SHA:0:6}")" >> $GITHUB_OUTPUT
echo "RELEASE_TIME=$(git show -s --format=%cI HEAD)" >> $GITHUB_OUTPUT
- name: Publish test version to Registry
uses: elgohr/Publish-Docker-Github-Action@v4
env:
GIT_HASH: ${{ steps.version.outputs.RELEASE_VERSION }}
GIT_TIME: ${{ steps.version.outputs.RELEASE_TIME }}
with:
name: cybertec/pgwatch2-postgres
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: docker/Dockerfile-postgres
buildargs: GIT_HASH,GIT_TIME
tags: ${{ github.ref_name }}

0 comments on commit f5d616b

Please sign in to comment.