generated from Monogramm/project-template
-
Notifications
You must be signed in to change notification settings - Fork 4
61 lines (52 loc) · 1.87 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
52
53
54
55
56
57
58
59
60
61
name: Docker Image CI
on:
pull_request:
push:
branches:
- main
- master
- develop
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
variant: ['debian', 'alpine']
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 }}
export EXPORT_TESTS_RESULTS=true
./hooks/run build ${{ matrix.variant }} 'fpm'
- name: Display docker images
run: docker images
- name: Execute CI test hooks
id: docker_test
run: |
export EXPORT_TESTS_RESULTS=true
./hooks/run test ${{ matrix.variant }} 'fpm'
ls -al ./coverage
- name: Codacy Coverage Reporter
uses: codacy/[email protected]
continue-on-error: true
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage/coverage-phpunit-cobertura.xml
- 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 GitHub Container Registry
#export DOCKER_REGISTRY=ghcr.io
#export DOCKER_LOGIN=${{ github.repository_owner }}
#export DOCKER_PASSWORD=${{ secrets.GITHUB_REGISTRY_TOKEN }}
#./hooks/run push
# 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.variant }}