-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (52 loc) · 1.64 KB
/
deployment.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
name: Deployment
on:
schedule:
- cron: '0 0 * * 1'
workflow_dispatch: {}
permissions:
packages: write
jobs:
get_versions:
name: Get Versions
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get_versions.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get PostgreSQL Versions
id: get_versions
run: echo "matrix=$(bash get-postgres-versions.sh)" >> "$GITHUB_OUTPUT"
push_images:
name: Push Images
needs: get_versions
runs-on: ubuntu-latest
strategy:
matrix:
version: ${{ fromJson(needs.get_versions.outputs.matrix).versions }}
steps:
- run: echo "Publishing danielptv/postgres-multiple-databases:${{ matrix.version }} to Docker Hub and GitHub Container Registry"
- name: Checkout
uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
build-args:
POSTGRES_TAG=${{ matrix.version }}
push: true
tags: |
danielptv/postgres-multiple-databases:${{ matrix.version }}
ghcr.io/danielptv/postgres-multiple-databases:${{ matrix.version }}