Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an optional image-tag input param to the S3 upload action #20

Merged
merged 2 commits into from
May 24, 2024

Conversation

mfitz
Copy link
Contributor

@mfitz mfitz commented May 24, 2024

Verifying the change

I have tested this using a branch of Gelato (PR for that soon @KasiaKoz). That caller build uses the AWS upload action from this branch, configured thus:

jobs:
  verify:
    name: Verify
    runs-on: ubuntu-latest
    outputs:
      image-tag: ${{ steps.make-image-tags.outputs.IMAGE_TAG }}

    - name: Make image tags
      id: make-image-tags
      run: |
        artifact=`grep "<artifactId" pom.xml | head -n 1 | awk -F"<artifactId>" '{print $2}' | awk -F "</artifactId" '{print $1}'`
        version=`grep "<version" pom.xml | head -n 1 | awk -F"<version>" '{print $2}' | awk -F "</version" '{print $1}'`
        version_tag=$artifact-$version-$branch-$GITHUB_SHA
        echo "Image version tag: $version_tag"
        echo "IMAGE_TAG=$version_tag" >> "$GITHUB_OUTPUT"

  aws-upload:
    needs: verify
    if: needs.verify.result == 'success'
    uses: arup-group/actions-city-modelling-lab/.github/workflows/aws-upload.yml@add-input-param-to-s3-upload-action
    secrets: inherit
    with:
      image-tag: ${{ needs.verify.outputs.image-tag }}

Build result

The build ran to completion:

Screenshot 2024-05-24 at 17 10 19 Screenshot 2024-05-24 at 17 24 20

Verifying the uploaded zip file

I grabbed the uploaded zip file from S3 and confirmed that it contains the expected image_tags file:

unzip -p gelato-repo-new-3.zip image_tags > extracted_image_tags; cat extracted_image_tags
gelato-0.0.4-alpha--c73430e02514cf29dd46c076956bfae8cbf3946c

@mfitz mfitz merged commit b7e1e03 into main May 24, 2024
1 check passed
@mfitz mfitz deleted the add-input-param-to-s3-upload-action branch May 24, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an optional image_tags input parameter to the AWS Upload reusable action
2 participants