-
Notifications
You must be signed in to change notification settings - Fork 230
53 lines (44 loc) · 1.64 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Build & Test
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-docker-images:
if: ${{ github.event.pull_request.head.repo.full_name == 'cybertec-postgresql/pgwatch2' }} # allow only local repo PRs
name: Test Docker Image on Ubuntu
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Check goreleaser configuration
uses: goreleaser/goreleaser-action@v5
with:
args: check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Publish test version to Registry
uses: elgohr/Publish-Docker-Github-Action@v5
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 }}
platforms: linux/amd64,linux/arm64