Skip to content

Commit

Permalink
feat: #661 Change the deployment to S3 sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mkleszcz committed Sep 19, 2024
1 parent d7c3f01 commit d02ba10
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/actions/deploy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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}"

0 comments on commit d02ba10

Please sign in to comment.