This action is a part of GitHub Actions Library created by rtCamp.
A GitHub Action to deploy Frappe app on a server
- Create a
.github/workflows/deploy.yml
file in your GitHub repo, if one doesn't exist already. - Add the following code to the
deploy.yml
file.
on:
push:
branches:
- main
- staging
name: Deploying Frappe Site
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Deploy
uses: rtcamp/action-deploy-frappe@main
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
-
Create
SSH_PRIVATE_KEY
secret using GitHub Action's Secret and store the private key that you use use to ssh to server(s) defined inhosts.yml
. -
Create
.github/hosts.yml
inventory file, based on
main:
hostname: production.com
user: frappe
site_name: production-site.com
deploy_path: /home/frappe/production
staging:
hostname: staging.com
user: frappe
site_name: staging-site.com
deploy_path: /home/frappe/staging
Make sure you explictly define GitHub branch mapping. Only the GitHub branches mapped in hosts.yml
will be deployed, rest will be filtered out.
- All of these variables are mandatory.
Variable | Possible Values | Purpose |
---|---|---|
hostname |
ip or DNS FQDN | hostname for ssh. |
user |
valid username | Username for ssh. |
site_name |
site name | Frappe Site Name for app installation. |
deploy_path |
path | Bench path. |
This GitHub action's behavior can be customized using following environment variables:
Variable | Default | Possible Values | Purpose |
---|---|---|---|
FRAPPE_BRANCH |
version-14 | Valid Frappe Branch | Frappe branch. If not specified, default branch version-14 will be used. |
If you need to modify the main.sh shell script of this action, you can create a file at location .github/deploy/addon.sh
in your git repository. Checkout the example addon.sh to see how to customize.
- Only supports one site per bench.
MIT © 2023 rtCamp