-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Create build-deploy-ec2.yml #546
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @paulespinosa,
Looks great! Have you been deploying manually up to this point? If so, I'm sure this will make your life a lot easier.
I just have a few minor comments and questions.
- name: Test with tox | ||
working-directory: ./api | ||
run: | | ||
tox |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the successful build log? https://github.com/hackforla/HomeUniteUs/actions/runs/5651696696/job/15310200967
If so, I can't seem to find the tox
step. Am I overlooking it? I'm mostly wondering because the api
test cases were failing on my machine. I'd expect them to fail here to, unless I'm missing something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️That link I posted was the PR build link haha.
Have you tried out the workflow and confirmed that it worked? If so, can I take a look at the deployment log?
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😊 Actually, I'm currently figuring out how to test it without merging to the main branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried out this workflow yet? It might be worth sending off a build before approving, to ensure the SSH access is working.
Do we have a development EC2 instance? If we did, then we wouldn't have to worry about breaking the current site
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Joshua-Douglas Yes, I've got it in a testable state and have been modifying it. You can see all of the runs in the Actions tab.
At this time, we have just one EC2 instance. It hosts the static landing page for https://homeunite.us/ and acts as the dev/test/demo host for https://dev.homeunite.us. As of this writing, it's hosting an old version of the frontend and the backend is down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Joshua-Douglas It looks like the SSH keys aren't configured in GitHub secrets yet. We'll need to check with @tylerthome about that.
As far as I can tell, we haven't been deploying code for quite a while. I think Tyler was manually doing the deployments in the past. |
Ah, that is great to know. Thanks. Now I've got a bunch of questions about the version of our deployment and our deployment strategy. I'll ask at today's meeting! Either way, thanks for getting this started! |
@paulespinosa you may need to set the working directory to |
@erikguntner Thank you for catching that. I added it back in and it looks like its working again. |
This initial GitHub Workflow builds and uploads the Home Unite Us front-end application and back-end API web service to the EC2 instance currently used for the Home Unite Us project. In this commit, the workflow does not cause the uploaded packages to run. That will come after testing and refining this commit. related #465
fe2de99
to
ef6948e
Compare
@tylerthome For this workflow, I used the shimataro ssh key action with the following configuration:
When the workflow runs, it appears that the shimataro ssh key action isn't picking up the Also, it looks like we'll need to add the .env variables to GitHub secrets because the workflow runs tox as a step. When the tests runs the |
Trying with a different name for the SSH key
Change the name of the SSH key for the app build
Refactor: two parallel jobs that build the API and APP and a deploy job that depends on both of the build steps to be successful. Uses build artifacts to move the builds to the deploy job. Added caching python and node dependencies.
Comment out running tests in order to test the deploy job
Added the homeunite.us public key
Make comment about the server's public key
Added deploy script
Added SSH key for SSH remote commands action
Use rsync to move app files
The workflow is being added to the PR #544 because the changes are related. This PR is being closed. |
This initial GitHub Workflow, as a manual action, builds and uploads the Home Unite Us front-end application and back-end API web service to the EC2 instance currently used for the Home Unite Us project.
In this commit, the workflow does not cause the uploaded packages to run. That will come after testing and refining this commit.
related #465