updated deploy yaml #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD | |
on: | |
pull_request: | |
types: [closed] | |
branches: | |
- main | |
- staging | |
- development | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.merged == true | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 20.x | |
- name: Installing Dependencies | |
run: npm install | |
- name: Build Development | |
if: github.base_ref == 'development' | |
run: npm run deploy-dev | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
- name: Build Staging | |
if: github.base_ref == 'staging' | |
run: npm run deploy-staging | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
- name: Build Production | |
if: github.base_ref == 'main' | |
run: npm run deploy-main | |
env: | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} |