Github action for deployment on managed instance.
.github/workflows/deploy.yml
file in your GitHub repo, if one doesn't exist already.deploy.yml
file.on: push
name: Deploying WordPress Site
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy
uses: docker://ghcr.io/rtcamp/action-deploy-on-managed-instance:latest
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
NPM_VERSION: 7.20.5
NODE_VERSION: 14.17.6
BUILD_DIRECTORY: buildDirectory/
BUILD_COMMAND: echo "buildCommand"
BUILD_SCRIPT: path/to/custom/script.sh
DEPLOY_LOCATIONS: ./locations.csv
VIP: false
SSH_PRIVATE_KEY
secret using GitHub Action's Secret and store the private key that you use use to ssh to server(s) defined in hosts.yml
..github/hosts.yml
inventory file, based on Deployer inventory file format. Make sure you explictly define GitHub branch mapping. Only the GitHub branches mapped in hosts.yml
will be deployed, rest will be filtered out. Here is a sample hosts.yml.This GitHub action's behavior can be customized using following environment variables:
Variable | Default | Possible Values | Purpose |
---|---|---|---|
NPM_VERSION |
null | 14.17.0 | NPM Version. If not specified, latest version will be used. |
NODE_VERSION |
null | 16.6.0 | Node Version. If not specified, latest version will be used. |
BUILD_DIRECTORY |
null | buildDirectory/ | Build directory. Generally root directory or directory like frontend |
BUILD_COMMAND |
null | npm run build | Command used to compile the package and/or files etc. |
BUILD_SCRIPT |
null | runTests.sh |
Custom or predefined script to run after compilation. |
DEPLOY_LOCATIONS |
null | ./locations.csv | csv file for locations needs to deployed on host. |
VIP |
null | True, False | For VIP plugins to be installed and deployed. |
Name | Github Username |
---|---|
Jay Shamnani | @JayShamnani |
main
fix/issue-name
For example, fix/shell-script-errors
feature/issue-name
For example, feature/add-plugin
AC-3 Added support for EC2
.