Skip to content

Commit 59b246e

Browse files
committed
CI: modernize
1 parent 32e1392 commit 59b246e

File tree

1 file changed

+20
-49
lines changed

1 file changed

+20
-49
lines changed

.github/workflows/docker.yml

Lines changed: 20 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,31 @@
11
name: Docker
22

33
on:
4+
workflow_dispatch:
5+
46
push:
5-
branches: master
7+
branches: ["master"]
68

79
jobs:
8-
docker:
9-
runs-on: ubuntu-latest
10+
build:
11+
name: "Build"
12+
uses: dockette/.github/.github/workflows/docker.yml@master
13+
secrets: inherit
14+
with:
15+
image: "dockette/postgres"
16+
tag: "${{ matrix.item }}"
17+
context: "${{ matrix.item }}"
1018
strategy:
1119
matrix:
1220
include:
13-
- { version: "10", folder: "10" }
14-
- { version: "11", folder: "11" }
15-
- { version: "12", folder: "12" }
16-
- { version: "13", folder: "13" }
17-
- { version: "14", folder: "14" }
18-
- { version: "15", folder: "15" }
19-
- { version: "16", folder: "16" }
20-
- { version: "17", folder: "17" }
21-
- { version: "18", folder: "18" }
22-
- { version: "latest", folder: "18" }
21+
- item: "10"
22+
- item: "11"
23+
- item: "12"
24+
- item: "13"
25+
- item: "14"
26+
- item: "15"
27+
- item: "16"
28+
- item: "17"
29+
- item: "18"
2330

2431
fail-fast: false
25-
26-
name: Docker (dockette/postgres:${{ matrix.version }})
27-
28-
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v2
31-
32-
- name: Login to DockerHub
33-
uses: docker/login-action@v1
34-
with:
35-
username: ${{ secrets.DOCKERHUB_USERNAME }}
36-
password: ${{ secrets.DOCKERHUB_TOKEN }}
37-
38-
- name: Set up QEMU
39-
uses: docker/setup-qemu-action@v1
40-
41-
- name: Set up Docker Buildx
42-
uses: docker/setup-buildx-action@v1
43-
44-
- name: Cache Docker layers
45-
uses: actions/cache@v2
46-
with:
47-
path: /tmp/.buildx-cache
48-
key: ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.version }}
49-
restore-keys: |
50-
${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.version }}
51-
52-
- name: Build and push
53-
uses: docker/build-push-action@v2
54-
with:
55-
file: ${{ matrix.folder }}/Dockerfile
56-
push: true
57-
tags: dockette/postgres:${{ matrix.version }}
58-
cache-from: type=local,src=/tmp/.buildx-cache
59-
cache-to: type=local,dest=/tmp/.buildx-cache
60-
platforms: linux/amd64,linux/arm64

0 commit comments

Comments
 (0)