-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (78 loc) · 2.9 KB
/
Copy pathdocker.yml
File metadata and controls
85 lines (78 loc) · 2.9 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
name: Docker
on:
pull_request:
workflow_dispatch:
merge_group:
schedule:
- cron: "0 0 * * *"
push:
branches: [ "main" ]
release:
types: [ published ]
permissions: read-all
jobs:
lint:
name: Lint Dockerfile
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: hadolint/hadolint-action@2332a7b74a6de0dda2e2221d575162eba76ba5e5 # v3.3.0
build:
name: Build and publish
runs-on: ubuntu-24.04-arm
permissions:
contents: read
packages: write
attestations: write
id-token: write
security-events: write
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- uses: docker/login-action@c99871dec2022cc055c062a10cc1a1310835ceb4 # v4.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4.2.0
- uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
id: meta
env:
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=schedule
type=semver,pattern={{raw}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=ref,event=branch
type=ref,event=pr
# on.schedule: nightly
# on.push:tag: latest (auto), v1.2.3, v.1,2, v.1
# on.push.branch: branchName
# on.pull_request: pr-number (won't be pushed)
- uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7.3.0
with:
push: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
files: |
cwd://${{ steps.meta.outputs.bake-file }}
cwd://${{ steps.meta.outputs.bake-file-annotations }}
./docker-bake.hcl
sbom: true
provenance: true
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
- uses: anchore/scan-action@e1165082ffb1fe366ebaf02d8526e7c4989ea9d2 # v7.4.0
id: scan
if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
with:
image: "ghcr.io/bsstudio/bss-web-graphql-backend:${{ env.DOCKER_METADATA_OUTPUT_VERSION }}"
cache-db: true
severity-cutoff: 'high'
fail-build: false
- uses: github/codeql-action/upload-sarif@54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4.36.3
if: ${{ github.event_name != 'pull_request' && github.event_name != 'merge_group' }}
with:
sarif_file: ${{ steps.scan.outputs.sarif }}