-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (78 loc) · 2.61 KB
/
Copy pathmaster_build_release.yml
File metadata and controls
90 lines (78 loc) · 2.61 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Publish Docker image
on:
push:
tags:
- '*'
env:
build_latest: auto
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2.2.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.3.0
with:
images: quadstingray/webtrees
flavor: |
latest=${{ env.build_latest }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push base Docker image
uses: docker/build-push-action@v4.0.0
with:
context: ./webtrees
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Extract metadata (tags, labels) for Vesta Docker
id: metavesta
uses: docker/metadata-action@v4.6.0
with:
images: quadstingray/webtrees
flavor: |
latest=false
tags: |
type=semver,pattern={{version}}-vesta
type=semver,pattern={{major}}.{{minor}}-vesta
type=semver,pattern={{major}}-vesta
type=raw,value=latest-vesta
- name: Build and push Vesta Docker image
uses: docker/build-push-action@v4.0.0
with:
context: ./vesta
push: true
tags: ${{ steps.metavesta.outputs.tags }}
labels: ${{ steps.metavesta.outputs.labels }}
- name: Update readme at Dockerhub
if: ${{ env.build_latest == 'auto' }}
uses: meeDamian/sync-readme@v1.0.6
with:
user: ${{ secrets.DOCKERHUB_USER }}
pass: ${{ secrets.DOCKERHUB_PASSWORD }}
slug: quadstingray/webtrees
readme: README.md
description: true
- name: Run Trivy vulnerability scanner
if: ${{ env.build_latest == 'auto' }}
uses: aquasecurity/trivy-action@master
with:
image-ref: 'quadstingray/webtrees:latest'
format: 'sarif'
output: 'trivy-results.sarif'
ignore-unfixed: true
- name: Upload Trivy scan results to GitHub Security tab
if: ${{ env.build_latest == 'auto' }}
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'