-
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@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ inputs.ref }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
- name: Build Docker image
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.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