This is an example of a github action that automatically merges master branch with production branch Use cases of this is wide:
- Example is automatically running test on your source code and if they passed, you can automatically build the file and push it to production, and then deploy the production branch on an online server
Learn more about github actions here
name: Update Production
on:
push:
branches:
- master
permissions:
# Need `contents: read` to checkout the repository
# Need `contents: write` to merge branches
contents: write
jobs:
update-production:
name: Merge master into production after a PR is merged
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0 # Let's get all the branches
- name: Merge Master to Production branch
uses: devvspaces/merge-branches@v1
with:
token: ${{ github.token }}
from_branch: master
to_branch: production