diff --git a/.github/workflows/aws-upload.yml b/.github/workflows/aws-upload.yml index 2c738ba..82a3dfb 100644 --- a/.github/workflows/aws-upload.yml +++ b/.github/workflows/aws-upload.yml @@ -8,6 +8,16 @@ on: required: true AWS_S3_CODE_BUCKET: required: true + inputs: + image-tag: + description: > + An optional value to write into an image_tags file + before zipping and uploading the repo contents. The + image_tags file is used in some downstream Docker image + builds to tag the image with arbitrary values. + required: false + type: string + default: 'no-tags' jobs: upload-to-aws: @@ -26,9 +36,14 @@ jobs: release_name=`echo ${{ github.actor }}-${{ github.ref_name }}` echo "Release name: $release_name" echo $release_name > release_name + - name: Add optional image tags + if: inputs.image-tag != 'no-tags' + run: | + echo "Making an image_tags file with tag value: ${{ inputs.image-tag }}" + echo ${{ inputs.image-tag }} > image_tags - name: Zip release run: | echo ${{ github.sha }} > release zip -r app.zip . - name: Push zip to S3 - run: aws s3 cp app.zip "s3://${{ secrets.AWS_S3_CODE_BUCKET }}/${{ github.event.repository.name }}.zip" \ No newline at end of file + run: aws s3 cp app.zip "s3://${{ secrets.AWS_S3_CODE_BUCKET }}/${{ github.event.repository.name }}.zip" diff --git a/CHANGELOG.md b/CHANGELOG.md index 5992878..dd8580b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Check whether project and parent template have diverged - GitHub Action to validate the reusable workflows themselves +- Optional `image-tags` input parameter added to the AWS Upload workflow ([#19](https://github.com/arup-group/actions-city-modelling-lab/issues/19)) ### Changed