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

Automated Linode deployment for production and staging #55

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

stojkovicv
Copy link
Member

Description

This PR adds the deployment automation script which is triggered on every code change in the development or master branch. It will automatically connect to the Linode instance over the SSH protocol, pull the latest code and reactivate the web servers. Linode instance hosts two separate folders, one for the master code and another for the development, just to keep things tidy. The Nginx proxy is configured to activate authentication for two locations:

  1. /webui -> deploying latest master code
  2. /webui-staging -> deploying latest development code

In order for this pipeline to work, 3 secret values has to be configured in the settings of this repository: ssh key, linode user and the machine's IP address.

Related Issue: #54

@stojkovicv stojkovicv added enhancement New feature or request feature Additional scope of functional operations labels Aug 26, 2024
@dsilhavy
Copy link
Contributor

Thanks @stojkovicv I suggest to split this up into two jobs. It looks like a change to the master branch will also redeploy the development branch and vice versa. What we can do is define a common job that takes some configuration variables like the port and the target folder. Then we use this common job in two separate jobs triggered for the development branch and the master branch. A similar example can be found here: https://github.com/Dash-Industry-Forum/dash.js/tree/development/.github/workflows

  • deploy.yml: Defines the main job
  • deploy_latest.yml: Deploys the latest stable version using deploy.yml by providing the required parameters
  • deploy_nightly: Deploys the latest staging version using deploy.yml by providing the required parameters

@dsilhavy dsilhavy self-requested a review August 27, 2024 05:51
@dsilhavy dsilhavy added this to the Version 1.1.0 milestone Aug 27, 2024
@stojkovicv
Copy link
Member Author

stojkovicv commented Aug 28, 2024

I changed pipeline's structure to conduct one main workflow for two different scenarios. I also tested it on my fork repository for both deployment types.

Copy link
Contributor

@dsilhavy dsilhavy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good @stojkovicv , much cleaner that way.

@dsilhavy
Copy link
Contributor

@stojkovicv Please add the required secrets to the project. Let me know if you are running into issues

@stojkovicv stojkovicv merged commit 95d4406 into development Aug 29, 2024
@stojkovicv stojkovicv deleted the feature/automated-deployment branch August 29, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature Additional scope of functional operations
Projects
Development

Successfully merging this pull request may close these issues.

2 participants