-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·51 lines (50 loc) · 1.53 KB
/
cd.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: Continuous Deployment
on:
release:
types: [published]
jobs:
docker:
permissions:
contents: read
security-events: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Github Container Registry
uses: docker/login-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
- name: Set tag name
id: tag
run: echo ::set-output name=tag_name::${GITHUB_REF#*\/*\/}
env:
GITHUB_REF: ${{ github.ref }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/Dockerfile
push: true
tags: |
ghcr.io/artefactory/github_tests_validator_app:${{ steps.tag.outputs.tag_name }}
ghcr.io/artefactory/github_tests_validator_app:latest
cache-from: type=registry,ref=ghcr.io/artefactory/github_tests_validator_app:latest
cache-to: type=inline
- name: Scan image
uses: anchore/scan-action@v3
id: scan
with:
image: "ghcr.io/artefactory/github_tests_validator_app:${{ steps.tag.outputs.tag_name }}"
severity-cutoff: "low"
- name: upload Anchore scan SARIF report
if: success() || failure()
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ steps.scan.outputs.sarif }}
category: anchore