1+ name : Build and Push Integration Test
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ tag_suffix :
7+ description : ' Optional tag suffix (defaults to commit hash)'
8+ required : false
9+ type : string
10+ base_tag :
11+ description : ' Base tag to use (defaults to latest release tag)'
12+ required : false
13+ type : string
14+ workflow_call :
15+ inputs :
16+ tag_suffix :
17+ description : ' Optional tag suffix (defaults to commit hash)'
18+ required : false
19+ type : string
20+ base_tag :
21+ description : ' Base tag to use (defaults to latest release tag)'
22+ required : false
23+ type : string
24+ secrets :
25+ app_id :
26+ required : true
27+ app_private_key :
28+ required : true
29+ role_to_assume :
30+ required : true
31+ aws_region :
32+ required : true
33+ repository_url :
34+ required : true
35+ domain_owner :
36+ required : true
37+
38+ jobs :
39+ generate-tag :
40+ runs-on : ubuntu-latest
41+ outputs :
42+ image_tag : ${{ steps.tag.outputs.image_tag }}
43+ steps :
44+ - name : Checkout code
45+ uses : actions/checkout@v4
46+ with :
47+ fetch-depth : 0
48+
49+ - name : Get commit hash
50+ id : commit
51+ run : echo "hash=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
52+
53+ - name : Get latest release tag
54+ id : latest_tag
55+ run : |
56+ # Get the latest release tag, fallback to 'latest' if none found
57+ LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "latest")
58+ echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
59+
60+ - name : Generate image tag
61+ id : tag
62+ run : |
63+ BASE_TAG="${{ inputs.base_tag || steps.latest_tag.outputs.tag }}"
64+ TAG_SUFFIX="${{ inputs.tag_suffix || steps.commit.outputs.hash }}"
65+ IMAGE_TAG="${BASE_TAG}-${TAG_SUFFIX}"
66+ echo "image_tag=$IMAGE_TAG" >> $GITHUB_OUTPUT
67+
68+ build-and-push-integration-test :
69+ needs : generate-tag
70+ uses : propeller-heads/ci-cd-templates/.github/workflows/build-and-push-docker-image.yaml@main
71+ permissions :
72+ id-token : write
73+ contents : read
74+ with :
75+ image_tag : ${{ needs.generate-tag.outputs.image_tag }}
76+ image_name : tycho-integration-test
77+ secrets :
78+ app_id : ${{ secrets.app_id }}
79+ app_private_key : ${{ secrets.app_private_key }}
80+ role_to_assume : ${{ secrets.role_to_assume }}
81+ aws_region : ${{ secrets.aws_region }}
82+ repository_url : ${{ secrets.repository_url }}
83+ domain_owner : ${{ secrets.domain_owner }}
0 commit comments