-
Notifications
You must be signed in to change notification settings - Fork 21
51 lines (43 loc) · 1.59 KB
/
hooks.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
name: Docker Image CI
on:
pull_request:
push:
branches:
- main
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
platforms: ['linux/amd64'] # Not working yet in GHA (but works locally): linux/arm64,linux/arm/v7,linux/arm/v6
steps:
- name: Check Out Repo
uses: actions/checkout@v2
- name: Execute CI build hooks
id: docker_build
run: |
# Export variables to tag against GitHub Container Registry
#export DOCKER_REGISTRY=ghcr.io
#export DOCKER_REPO=${{ github.repository }}
./hooks/run build ${{ matrix.platforms }}
- name: Display docker images
run: docker images
- name: Execute CI test hooks
id: docker_test
run: |
./hooks/run test ${{ matrix.platforms }}
- name: Execute CI push hooks
id: docker_push
if: ${{ github.event_name == 'push' && ( github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' ) }}
run: |
# Export variables to login and push to DockerHub Registry
export DOCKER_LOGIN=${{ secrets.DOCKERHUB_REGISTRY_LOGIN }}
export DOCKER_PASSWORD=${{ secrets.DOCKERHUB_REGISTRY_TOKEN }}
./hooks/run push ${{ matrix.platforms }}
# Export variables to login and push to GitHub Container Registry
#export DOCKER_REGISTRY=ghcr.io
#export DOCKER_LOGIN=${{ github.repository_owner }}
#export DOCKER_PASSWORD=${{ secrets.GITHUB_REGISTRY_TOKEN }}
#./hooks/run push ${{ matrix.platforms }}