Repository navigation
59 lines (52 loc) · 1.83 KB
/
Copy pathdocker-build.yml
File metadata and controls
59 lines (52 loc) · 1.83 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
# This is a basic workflow to help you get started with Actions
name: Docker Build
on:
workflow_call:
secrets:
github-token:
required: true
inputs:
envFile:
required: false
type: string
default: .env.github
discordWebhook:
required: false
type: string
dockerBuildArgs:
required: false
type: string
dockerImageTags:
required: false
type: string
default: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ github.sha }}
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: cardinalby/export-env-action@4f48c4676cf6ed6f46e30899ee987ce695da7c80 # 2.2.3
with:
envFile: ${{ inputs.envFile }}
- name: Log in to the Container registry
uses: docker/login-action@650006c6eb7dba73a995cc03b0b2d7f5ca915bee # v4.2.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.github-token }}
- uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
env:
baseImage: BASE_IMAGE=oven/bun:${{ env.BUN_VERSION || 'latest' }}-slim
with:
push: true
context: .
build-args: ${{ inputs.dockerBuildArgs || env.baseImage }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ inputs.dockerImageTags }}
- uses: sarisia/actions-status-discord@eb045afee445dc055c18d3d90bd0f244fd062708 # v1.16.0
if: ${{ failure() && inputs.discordWebhook }}
with:
webhook: ${{ inputs.discordWebhook }}