-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.yaml
More file actions
37 lines (34 loc) · 1.11 KB
/
Copy pathbuild.yaml
File metadata and controls
37 lines (34 loc) · 1.11 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
on:
workflow_call:
inputs:
sha-tag:
description: "A short-form SHA tag for the commit that triggered this flow"
required: true
type: string
lower-repo:
description: "The repository name in lowercase"
required: true
type: string
jobs:
build:
name: Build & Push
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Github Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v7
with:
push: ${{ github.ref_name == github.event.repository.default_branch }}
cache-from: type=registry,ref=ghcr.io/${{ inputs.lower-repo }}:latest
cache-to: type=inline
tags: |
ghcr.io/${{ inputs.lower-repo }}:latest
ghcr.io/${{ inputs.lower-repo }}:${{ inputs.sha-tag }}
build-args: git_sha=${{ github.sha }}