Skip to content

Commit 055402e

Browse files
committed
CI: added github actions
1 parent 2bef401 commit 055402e

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/docker.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Docker
2+
3+
on:
4+
push:
5+
branches: master
6+
7+
jobs:
8+
docker:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
include:
13+
- version: "10"
14+
- version: "11"
15+
- version: "12"
16+
- version: "13"
17+
18+
fail-fast: false
19+
20+
name: Docker (dockette/postgres:${{ matrix.version }})
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
26+
- name: Login to DockerHub
27+
uses: docker/login-action@v1
28+
with:
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_TOKEN }}
31+
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v1
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v1
37+
38+
- name: Cache Docker layers
39+
uses: actions/cache@v2
40+
with:
41+
path: /tmp/.buildx-cache
42+
key: ${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.version }}
43+
restore-keys: |
44+
${{ runner.os }}-buildx-${{ github.sha }}-${{ matrix.version }}
45+
46+
- name: Build and push
47+
uses: docker/build-push-action@v2
48+
with:
49+
file: ${{ matrix.version }}/Dockerfile
50+
push: true
51+
tags: dockette/postgres:${{ matrix.version }}
52+
cache-from: type=local,src=/tmp/.buildx-cache
53+
cache-to: type=local,dest=/tmp/.buildx-cache
54+
platforms: linux/amd64,linux/arm64

0 commit comments

Comments
 (0)