Skip to content

Commit a5c4044

Browse files
committed
Improve manual build
1 parent 081fd86 commit a5c4044

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

.github/workflows/build-manual.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
project_name: ${{ inputs.project_name }}
3737
push: ${{ inputs.push }}
3838
registry: harbor.puzzle.ch
39-
registry_url: harbor.puzzle.ch/pitc-ruby-public/ptime/int/rails
39+
# registry_url: ${{ vars.REGISTRY_URL }}
4040
secrets:
4141
PUZZLE_REGISTRY_USERNAME: ${{ secrets.PUZZLE_REGISTRY_USERNAME }}
4242
PUZZLE_REGISTRY_TOKEN: ${{ secrets.PUZZLE_REGISTRY_TOKEN }}

.github/workflows/reusable-build.yaml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: 'Reusable: Build and push image'
2+
name: "Reusable: Build and push image"
33

44
"on":
55
workflow_call:
@@ -17,27 +17,32 @@ name: 'Reusable: Build and push image'
1717
type: boolean
1818
default: false
1919
registry:
20-
description: 'FQDN of the registry'
20+
description: "FQDN of the registry"
2121
type: string
22-
required: true
22+
required: false
23+
default: ""
2324
registry_url:
24-
description: 'URL to push image to'
25+
description: "URL to push image to"
2526
type: string
2627
required: false
27-
default: 'harbor.puzzle.ch/pitc-ruby-public/ptime/int/rails'
28+
default: ""
2829

2930
secrets:
3031
PUZZLE_REGISTRY_USERNAME:
31-
description: 'Needed for the registry login'
32+
description: "Needed for the registry login"
3233
required: true
3334
PUZZLE_REGISTRY_TOKEN:
34-
description: 'Needed for the registry login'
35+
description: "Needed for the registry login"
3536
required: true
3637

3738
jobs:
3839
build:
3940
environment: ${{ inputs.environment }}
40-
runs-on: 'ubuntu-latest'
41+
runs-on: "ubuntu-latest"
42+
43+
env:
44+
BUILD_REGISTRY: ${{ inputs.registry || vars.REGISTRY }}
45+
BUILD_REGISTRY_URL: ${{ inputs.registry_url || vars.REGISTRY_URL }}
4146
steps:
4247
- uses: docker/setup-buildx-action@v3
4348
- uses: docker/login-action@v3
@@ -55,9 +60,8 @@ jobs:
5560
GITHUB_SHA=${{ github.sha }}
5661
target: app
5762
tags: |
58-
${{ inputs.registry_url }}:latest
59-
${{ inputs.registry_url }}:${{ github.sha }}
63+
${{ vars.REGISTRY_URL }}:latest
64+
${{ vars.REGISTRY_URL }}:git-${{ github.sha }}
6065
push: ${{ inputs.push }}
6166
cache-from: type=gha
6267
cache-to: type=gha,mode=max
63-
...

0 commit comments

Comments
 (0)