From d02ba107a70ab0d3057c68b76ce279b1027a51d6 Mon Sep 17 00:00:00 2001 From: Michal Kleszcz Date: Thu, 19 Sep 2024 13:46:53 +0200 Subject: [PATCH] feat: #661 Change the deployment to S3 sync --- .github/workflows/actions/deploy/action.yml | 23 +++++++++------------ 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/actions/deploy/action.yml b/.github/workflows/actions/deploy/action.yml index ef8011d7..dc8f17b3 100644 --- a/.github/workflows/actions/deploy/action.yml +++ b/.github/workflows/actions/deploy/action.yml @@ -18,18 +18,15 @@ runs: fetch-depth: 0 fetch-tags: 'true' - - name: Call Deploy Trigger Endpoint + - name: Set VERSION in environment shell: bash run: | - response=$(curl -s -w "%{http_code}" -o response_body.txt -X POST "${{ inputs.trigger-url }}?secret=$(echo -n '${{ inputs.trigger-secret }}' | jq -sRr @uri)" \ - -H "Content-Type: application/json" \ - -d '{ - "referenceName": "'"${GITHUB_REF_NAME}"'", - "deployTarget": "'"${{ inputs.environment-name }}"'" - }') - status_code=$(tail -n1 <<< "$response") - if [ "$status_code" -ne 200 ]; then - echo "Deployment trigger failed with status code $status_code" - cat response_body.txt - exit 1 - fi \ No newline at end of file + app_version=$(git describe --tags --first-parent --abbrev=11 --long --dirty --always)' + echo "VERSION=${app_version}" >> .env + + - name: Zip and send artifact to S3 + shell: bash + run: | + artifact_name="${{ inputs.environment-name }}-entrypoint.zip" + zip -r $artifact_name . + aws s3 cp $artifact_name "s3://${{ secrets.S3_BUCKET_NAME }}/${artifact_name}"