-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (43 loc) · 1.59 KB
/
dockerimage.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
name: Docker Image CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: [7.1, 7.2, 7.3]
include:
- php_version: 7.3
latest: true
steps:
- uses: actions/checkout@v1
- name: Build the Docker image
run: docker build . --file Dockerfile --tag vbyndych/oro-docker-php:${{ matrix.php_version }} --build-arg PHP_VERSION=${{ matrix.php_version }}
- name: Tag latest version
if: matrix.latest
run: docker tag vbyndych/oro-docker-php:${{ matrix.php_version }} vbyndych/oro-docker-php:latest
- name: Scan image
uses: anchore/scan-action@master
with:
image-reference: "vbyndych/oro-docker-php:${{ matrix.php_version }}"
fail-build: true
include-app-packages: true
- name: ZIP Image Scan results
uses: montudor/[email protected]
with:
args: zip -qq -r ./scan-report.zip ./anchore-reports
- name: Upload Image Scan results
uses: actions/upload-artifact@v1
with:
name: sacn-report-${{ matrix.php_version }}
path: scan-report.zip
- name: Login to DockerHub Registry
run: echo "$DOCKER_PASSWORD" | docker login --username $DOCKER_USERNAME --password-stdin
env:
DOCKER_USERNAME: ${{ secrets.GITHUB_DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_DOCKER_PASSWORD }}
- name: Push image to Dockerhub
run: docker push vbyndych/oro-docker-php:${{ matrix.php_version }}
- name: Push latest image to Dockerhub
if: matrix.latest
run: docker push vbyndych/oro-docker-php:latest