File tree Expand file tree Collapse file tree 3 files changed +8
-14
lines changed
Expand file tree Collapse file tree 3 files changed +8
-14
lines changed Original file line number Diff line number Diff line change 6363 uses : actions/checkout@v4
6464 with :
6565 fetch-depth : 0
66- - name : " Get short SHA"
67- id : sha
68- run : echo "short_sha=$(echo ${GITHUB_SHA} | cut -c1-7)" >> $GITHUB_OUTPUT
6966 - name : " Configure AWS credentials"
7067 uses : aws-actions/configure-aws-credentials@v4
7168 with :
@@ -76,12 +73,12 @@ jobs:
7673 id : copy-artefact
7774 run : |
7875 TAG=${{ github.ref_name }}
79- SHORT_SHA =${{ steps .sha.outputs.short_sha }}
76+ SHA =${{ github .sha }}
8077
81- if aws s3 ls "s3://${AWS_S3_ARTEFACTS_BUCKET}/sha/$SHORT_SHA /" | grep .; then
82- aws s3 cp "s3://${AWS_S3_ARTEFACTS_BUCKET}/sha/$SHORT_SHA " "s3://${AWS_S3_RELEASES_BUCKET}/tag/$TAG/" --recursive
78+ if aws s3 ls "s3://${AWS_S3_ARTEFACTS_BUCKET}/sha/$SHA /" | grep .; then
79+ aws s3 cp "s3://${AWS_S3_ARTEFACTS_BUCKET}/sha/$SHA " "s3://${AWS_S3_RELEASES_BUCKET}/tag/$TAG/" --recursive
8380 else
84- echo "Error: No build found for SHA: $SHORT_SHA "
81+ echo "Error: No build found for SHA: $SHA "
8582 exit 1
8683 fi
8784 - name : " Get commit history"
Original file line number Diff line number Diff line change 77 description : ' Environment to deploy to'
88 type : environment
99 required : true
10- tag :
11- description : " The commit SHA (DEV) or version tag (higher envs) to be deployed"
12- required : true
1310
1411env :
1512 AWS_REGION : eu-west-2
3229 - name : " Checkout code"
3330 uses : actions/checkout@v4
3431 with :
35- ref : ${{ github.event.inputs.tag }}
32+ ref : ${{ github.ref }}
3633 - name : " Set CI/CD variables"
3734 id : variables
3835 run : |
4542 echo "terraform_version=$(grep "^terraform" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
4643 # TODO: Get the version, but it may not be the .version file as this should come from the CI/CD Pull Request Workflow
4744 echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
48- echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
45+ echo "tag=${{ github.ref_name }}) " >> $GITHUB_OUTPUT
4946 - name : " List variables"
5047 run : |
5148 export BUILD_DATETIME="${{ steps.variables.outputs.build_datetime }}"
Original file line number Diff line number Diff line change 88 type : string
99 tag :
1010 description : " The commit SHA (DEV) or version tag (higher envs) to be deployed"
11- required : false
11+ required : true
1212 type : string
1313 environment :
1414 description : " Environment to deploy to"
1717
1818env :
1919 AWS_REGION : eu-west-2
20- TAG : ${{ inputs.tag || github.sha }}
20+ TAG : ${{ inputs.tag }}
2121
2222jobs :
2323 deploy :
You can’t perform that action at this time.
0 commit comments