-
Notifications
You must be signed in to change notification settings - Fork 7
60 lines (57 loc) · 1.68 KB
/
build.yml
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
name: Build
on:
workflow_call:
inputs:
ref:
description: The reference to build
type: string
required: true
image:
description: The name of the image to build
type: string
required: true
context:
description: The context used to build the image
type: string
required: true
stage:
description: The stage to build
type: string
required: false
dockerfile:
description: The path to the Dockerfile
type: string
required: false
outputs:
image-id:
description: The ID of image that has been built
value: ${{ jobs.build.outputs.image-id }}
jobs:
build:
runs-on: ubuntu-latest
outputs:
image-id: ${{ steps.build.outputs.image-id }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- id: build
name: Build and push
uses: cern-sis/gh-workflows/.github/actions/[email protected]
with:
image: ${{ inputs.image }}
context: ${{ inputs.context }}
stage: ${{ inputs.stage }}
dockerfile: ${{ inputs.dockerfile }}
registry: registry.cern.ch
cache: false
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_SECRET }}
build-args: |
DJANGO_AWS_STORAGE_BUCKET_NAME=${{ secrets.DEV_DJANGO_AWS_STORAGE_BUCKET_NAME }}
DJANGO_AWS_S3_CUSTOM_DOMAIN=${{ secrets.DEV_DJANGO_AWS_S3_CUSTOM_DOMAIN }}