Skip to content

Commit e65d1df

Browse files
committed
added tagging control
1 parent e542a64 commit e65d1df

3 files changed

Lines changed: 43 additions & 2 deletions

File tree

.github/workflows/dev_sandbox_publish_deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@ jobs:
9797
payload: |
9898
status: "${{ job.status }}"
9999
link: "https://github.com/${{ github.repository }}/commit/${{ github.sha }}"
100-
author: "${{ github.actor }}"
101-
title: "Pushed to main"
100+
triggered_by: "${{ github.actor }}"
101+
environment: "Specification updated in Dev & Sandbox"
102102
version: "${{ needs.metadata.outputs.version }}"

.github/workflows/preprod_publish_deploy.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,31 @@ name: Deploy to Preprod
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: "Tag to promote (e.g. spec-{timestamp})"
8+
default: latest
9+
required: true
510

611
jobs:
712
preprod:
813
runs-on: ubuntu-latest
914
steps:
1015
- uses: actions/checkout@v6
16+
- name: Set tag to deploy
17+
id: set_tag
18+
run: |
19+
if [ "${{ github.event.inputs.ref }}" = "latest" ]; then
20+
TAG=$(git tag --list 'spec-*' --sort=-v:refname | head -n 1)
21+
echo "Using latest tag: $TAG"
22+
echo "tag=$TAG" >> $GITHUB_OUTPUT
23+
else
24+
echo "tag=${{ github.event.inputs.ref }}" >> $GITHUB_OUTPUT
25+
fi
26+
- name: Checkout tag
27+
uses: actions/checkout@v6
28+
with:
29+
ref: ${{ steps.set_tag.outputs.tag }}
1130
- uses: actions/setup-python@v6
1231
with:
1332
python-version: '3.11'

.github/workflows/prod_publish_deploy.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@ name: Deploy to Prod
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
ref:
7+
description: "Tag to promote (e.g. spec-{timestamp})"
8+
required: true
59

610
jobs:
711
prod:
812
runs-on: ubuntu-latest
913
steps:
1014
- uses: actions/checkout@v6
15+
- name: Checkout tag
16+
uses: actions/checkout@v6
17+
with:
18+
ref: ${{ inputs.ref }}
1119
- uses: actions/setup-python@v6
1220
with:
1321
python-version: '3.11'
@@ -18,3 +26,17 @@ jobs:
1826
- run: make construct-spec APIM_ENV=prod
1927
- run: make publish-spec APIM_ENV=prod
2028
- run: make deploy-spec APIM_ENV=prod
29+
30+
create_release:
31+
needs: prod
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Create GitHub Release
35+
uses: actions/create-release@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
tag_name: ${{ inputs.ref }}
40+
release_name: Release ${{ inputs.ref }}
41+
draft: false
42+
prerelease: false

0 commit comments

Comments
 (0)