-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (51 loc) · 1.99 KB
/
build-and-push.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
54
55
56
57
58
59
60
61
62
name: "Deploy Image to DockerHub"
on:
push:
branches:
- master
jobs:
# Build a docker image for a specific version and using a given target
build_and_push:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- httpd-version: 2.4
steps:
- name: "Checkout Sourcecode"
uses: actions/checkout@v2
- name: "Set up Docker Buildx"
id: builder
uses: docker/setup-buildx-action@v1
- name: "Append ARM buildx builder from AWS"
uses: baschny/append-buildx-action@v1
with:
builder: ${{ steps.builder.outputs.name }}
endpoint: "ssh://[email protected]"
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: "Cache Docker layers"
uses: actions/cache@v2
with:
path: .buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.httpd-version }}-${{ github.sha }}
restore-keys: |
"${{ runner.os }}-buildx-${{ matrix.httpd-version }}-"
"${{ runner.os }}-buildx-"
- name: "Docker build httpd-${{ matrix.httpd-version }}"
run: make build HTTPD_VERSION=${{ matrix.httpd-version }}
- name: "Login to DockerHub"
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Docker push httpd-${{ matrix.httpd-version }}"
run: make build BUILDX_OPTIONS=--push HTTPD_VERSION=${{ matrix.httpd-version }}
- name: "Update Docker Hub Description (croneu/phpapp-web)"
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
# Note: the "TOKEN" does not work for the docker hub API yet, see
# https://github.com/peter-evans/dockerhub-description/issues/10
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: croneu/phpapp-web
short-description: ${{ github.event.repository.description }}