-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (57 loc) · 1.68 KB
/
action.yaml
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
61
name: Build and Release
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches: [ "main" ]
defaults:
run:
working-directory: ./
shell: bash
env:
REGISTRY: ghcr.io
ORGANISATION_NAME: whiteducksoftware
jobs:
prepare:
name: prepare
runs-on: ubuntu-latest
outputs:
SHA_SHORT: ${{ env.COMMIT_SHORT_SHA }}
REGISTRY: ${{ env.REGISTRY }}
ORGANISATION_NAME: ${{ env.ORGANISATION_NAME }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set short git commit SHA
id: short-sha
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
build:
name: build
uses: ./.github/workflows/docker-build.yaml
needs: [prepare]
with:
REGISTRY: ${{ needs.prepare.outputs.REGISTRY }}
ORGANISATION_NAME: ${{ needs.prepare.outputs.ORGANISATION_NAME }}
COMMIT_SHORT_SHA: ${{ needs.prepare.outputs.SHA_SHORT }}
patch:
name: patch
uses: ./.github/workflows/patch-image.yaml
if: github.event_name != 'pull_request'
needs: [prepare,build]
with:
REGISTRY: ${{ needs.prepare.outputs.REGISTRY }}
ORGANISATION_NAME: ${{ needs.prepare.outputs.ORGANISATION_NAME }}
COMMIT_SHORT_SHA: ${{ needs.prepare.outputs.SHA_SHORT }}
sign:
name: sign
uses: ./.github/workflows/sign-image.yaml
if: github.event_name != 'pull_request'
needs: [prepare,build,patch]
with:
REGISTRY: ${{ needs.prepare.outputs.REGISTRY }}
ORGANISATION_NAME: ${{ needs.prepare.outputs.ORGANISATION_NAME }}
COMMIT_SHORT_SHA: ${{ needs.prepare.outputs.SHA_SHORT }}