|
1 | 1 | name: Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - create: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + pull_request: |
5 | 8 |
|
6 | 9 | jobs: |
7 | 10 | release: |
8 | | - if: ${{ startsWith(github.ref, 'refs/tags/v') }} |
9 | 11 | runs-on: ubuntu-latest |
10 | 12 |
|
11 | 13 | steps: |
12 | | - - |
13 | | - name: Set up QEMU |
14 | | - uses: docker/setup-qemu-action@v3 |
15 | | - - |
16 | | - name: Set up Docker Buildx |
17 | | - uses: docker/setup-buildx-action@v3 |
| 14 | + - uses: docker/setup-qemu-action@v3 |
| 15 | + - uses: docker/setup-buildx-action@v3 |
18 | 16 | with: |
19 | 17 | version: v0.9.1 |
20 | | - - |
21 | | - name: Login to DockerHub |
22 | | - uses: docker/login-action@v3 |
| 18 | + |
| 19 | + - uses: docker/login-action@v3 |
| 20 | + if: github.event_name != 'pull_request' |
23 | 21 | with: |
24 | 22 | username: ${{ secrets.DOCKERHUB_USERNAME }} |
25 | 23 | password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 24 | + |
26 | 25 | - uses: actions/checkout@v6 |
27 | | - with: |
28 | | - fetch-depth: 0 |
29 | | - - |
30 | | - name: "Fetch latest tag" |
31 | | - id: get-latest-tag |
| 26 | + - id: get-latest-tag |
| 27 | + if: github.event_name != 'pull_request' |
32 | 28 | uses: "WyriHaximus/github-action-get-previous-tag@v2" |
33 | | - - |
34 | | - name: Build and push Postgres 15 |
| 29 | + |
| 30 | + - name: Build and push Postgres 15 |
35 | 31 | id: docker_build_15 |
36 | 32 | uses: docker/build-push-action@v6 |
37 | 33 | with: |
38 | 34 | build-args: | |
39 | 35 | PG_VERSION=15.10 |
40 | 36 | PG_MAJOR_VERSION=15 |
41 | | - VERSION=${{ steps.get-latest-tag.outputs.tag }} |
| 37 | + VERSION=${{ steps.get-latest-tag.outputs.tag || 'pr-build' }} |
42 | 38 | context: . |
43 | 39 | file: ./pg15/Dockerfile |
44 | | - push: true |
| 40 | + push: ${{ github.event_name != 'pull_request' }} |
45 | 41 | tags: | |
46 | 42 | flyio/postgres-flex:15 |
47 | 43 | flyio/postgres-flex:15.10 |
48 | | - - |
49 | | - name: Build and push Postgres 15 Timescale DB |
| 44 | +
|
| 45 | + - name: Build and push Postgres 15 Timescale DB |
50 | 46 | id: docker_build_15_timescaledb |
51 | 47 | uses: docker/build-push-action@v6 |
52 | 48 | with: |
53 | 49 | build-args: | |
54 | 50 | PG_VERSION=15.10 |
55 | 51 | PG_MAJOR_VERSION=15 |
56 | | - VERSION=${{ steps.get-latest-tag.outputs.tag }} |
| 52 | + VERSION=${{ steps.get-latest-tag.outputs.tag || 'pr-build' }} |
57 | 53 | context: . |
58 | 54 | file: ./pg15/Dockerfile-timescaledb |
59 | | - push: true |
| 55 | + push: ${{ github.event_name != 'pull_request' }} |
60 | 56 | tags: | |
61 | 57 | flyio/postgres-flex-timescaledb:15 |
62 | 58 | flyio/postgres-flex-timescaledb:15.10 |
63 | 59 |
|
64 | | - - |
65 | | - name: Build and push Postgres 16 |
| 60 | + - name: Build and push Postgres 16 |
66 | 61 | id: docker_build_16 |
67 | 62 | uses: docker/build-push-action@v6 |
68 | 63 | with: |
69 | 64 | build-args: | |
70 | 65 | PG_VERSION=16.6 |
71 | 66 | PG_MAJOR_VERSION=16 |
72 | | - VERSION=${{ steps.get-latest-tag.outputs.tag }} |
| 67 | + VERSION=${{ steps.get-latest-tag.outputs.tag || 'pr-build' }} |
73 | 68 | context: . |
74 | 69 | file: ./pg16/Dockerfile |
75 | | - push: true |
| 70 | + push: ${{ github.event_name != 'pull_request' }} |
76 | 71 | tags: | |
77 | 72 | flyio/postgres-flex:16 |
78 | 73 | flyio/postgres-flex:16.6 |
79 | | - - |
80 | | - name: Build and push Postgres 16 Timescale DB |
| 74 | +
|
| 75 | + - name: Build and push Postgres 16 Timescale DB |
81 | 76 | id: docker_build_16_timescaledb |
82 | 77 | uses: docker/build-push-action@v6 |
83 | 78 | with: |
84 | 79 | build-args: | |
85 | 80 | PG_VERSION=16.6 |
86 | 81 | PG_MAJOR_VERSION=16 |
87 | | - VERSION=${{ steps.get-latest-tag.outputs.tag }} |
| 82 | + VERSION=${{ steps.get-latest-tag.outputs.tag || 'pr-build' }} |
88 | 83 | context: . |
89 | 84 | file: ./pg16/Dockerfile-timescaledb |
90 | | - push: true |
| 85 | + push: ${{ github.event_name != 'pull_request' }} |
91 | 86 | tags: | |
92 | 87 | flyio/postgres-flex-timescaledb:16 |
93 | 88 | flyio/postgres-flex-timescaledb:16.6 |
94 | 89 |
|
95 | | - - |
96 | | - name: Build and push Postgres 17 |
| 90 | + - name: Build and push Postgres 17 |
97 | 91 | id: docker_build_17 |
98 | 92 | uses: docker/build-push-action@v6 |
99 | 93 | with: |
100 | 94 | build-args: | |
101 | 95 | PG_VERSION=17.2 |
102 | 96 | PG_MAJOR_VERSION=17 |
103 | | - VERSION=${{ steps.get-latest-tag.outputs.tag }} |
| 97 | + VERSION=${{ steps.get-latest-tag.outputs.tag || 'pr-build' }} |
104 | 98 | context: . |
105 | 99 | file: ./pg17/Dockerfile |
106 | | - push: true |
| 100 | + push: ${{ github.event_name != 'pull_request' }} |
107 | 101 | tags: | |
108 | 102 | flyio/postgres-flex:17 |
109 | 103 | flyio/postgres-flex:17.2 |
110 | | - - |
111 | | - name: Build and push Postgres 17 Timescale DB |
| 104 | +
|
| 105 | + - name: Build and push Postgres 17 Timescale DB |
112 | 106 | id: docker_build_17_timescaledb |
113 | 107 | uses: docker/build-push-action@v6 |
114 | 108 | with: |
115 | 109 | build-args: | |
116 | 110 | PG_VERSION=17.2 |
117 | 111 | PG_MAJOR_VERSION=17 |
118 | | - VERSION=${{ steps.get-latest-tag.outputs.tag }} |
| 112 | + VERSION=${{ steps.get-latest-tag.outputs.tag || 'pr-build' }} |
119 | 113 | context: . |
120 | 114 | file: ./pg17/Dockerfile-timescaledb |
121 | | - push: true |
| 115 | + push: ${{ github.event_name != 'pull_request' }} |
122 | 116 | tags: | |
123 | 117 | flyio/postgres-flex-timescaledb:17 |
124 | 118 | flyio/postgres-flex-timescaledb:17.2 |
125 | | - - |
126 | | - name: Postgres 15 Image digest |
| 119 | +
|
| 120 | + - name: Postgres 15 Image digest |
127 | 121 | run: echo ${{ steps.docker_build_15.outputs.digest }} |
128 | | - - |
129 | | - name: Postgres 15 TimescaleDB Image digest |
| 122 | + |
| 123 | + - name: Postgres 15 TimescaleDB Image digest |
130 | 124 | run: echo ${{ steps.docker_build_15_timescaledb.outputs.digest }} |
131 | | - - |
132 | | - name: Postgres 16 Image digest |
| 125 | + |
| 126 | + - name: Postgres 16 Image digest |
133 | 127 | run: echo ${{ steps.docker_build_16.outputs.digest }} |
134 | | - - |
135 | | - name: Postgres 16 TimescaleDB Image digest |
| 128 | + |
| 129 | + - name: Postgres 16 TimescaleDB Image digest |
136 | 130 | run: echo ${{ steps.docker_build_16_timescaledb.outputs.digest }} |
137 | | - - |
138 | | - name: Postgres 17 Image digest |
| 131 | + |
| 132 | + - name: Postgres 17 Image digest |
139 | 133 | run: echo ${{ steps.docker_build_17.outputs.digest }} |
140 | | - - |
141 | | - name: Postgres 17 TimescaleDB Image digest |
| 134 | + |
| 135 | + - name: Postgres 17 TimescaleDB Image digest |
142 | 136 | run: echo ${{ steps.docker_build_17_timescaledb.outputs.digest }} |
0 commit comments