-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (37 loc) · 1.07 KB
/
docker.yml
File metadata and controls
44 lines (37 loc) · 1.07 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
name: Docker
on:
workflow_call:
inputs:
ref:
required: true
type: string
image-name:
type: string
default: 'temp'
permissions:
contents: read
jobs:
Build-Container:
runs-on: ubuntu-latest
name: Build Container
steps:
- name: Harden runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.ref }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
- name: Build Docker image
uses: docker/build-push-action@1dc73863535b631f98b2378be8619f83b136f4a0 # v6.17.0
with:
context: .
file: ./Dockerfile
push: false
tags: ${{ inputs.image-name }}:${{ github.sha }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max