Anyone happen to know how to use "aws deploy" (or something else) to deploy to an EC2 instance from within a GH Action - meaning deploy the targets.
I have a GH Actions workflow that cross-builds a Rust project. It uses, per many examples, this command to "deploy" to EC2:
- name: Deploy
id: deploy
run: |
aws deploy create-deployment \
--application-name xxx \
--deployment-group-name xxxx \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--github-location repository=${{ github.repository }},commitId=${{ github.sha }}
(The other necessary parts - aws-actions/configure-aws-credentials and aws sts get-caller-identity - are there too, of course.)
So, all this does is deploy the repo there - the source. Not the targets that the workflow just built.
And, actions/upload-artifact builds an archive and makes it accessible via https - but doesn't copy it to the EC2 VM.
I know everybody loves docker now (I do too) but it's overkill for this. We just want to copy the built executables as part of the deployment. Is there any way to do this?
(An acceptable alternative would be using a post-script to download that archive and expand it - doable but not ideal.)