chore(version): 0.3.0 #15
Workflow file for this run
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: CI/CD Production Deployment | |
on: | |
pull_request: | |
branches: [ main ] | |
types: [ closed ] | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'release/') | |
steps: | |
- name: "Add GitHub to the SSH known hosts file" | |
run: | | |
mkdir -p -m 0700 /home/runner/.ssh | |
echo "${{ secrets.SSH_PRODUCTION_HOST }}" >> /home/runner/.ssh/known_hosts | |
chmod 600 /home/runner/.ssh/known_hosts | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Setup SSH Agent | |
uses: webfactory/ssh-agent@v0.8.0 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRODUCTION_PRIVATE_KEY }} | |
- name: Deploy to production server | |
run: ssh -o UserKnownHostsFile=/home/runner/.ssh/known_hosts ${{ secrets.SSH_PRODUCTION_SERVER }} 'bash ${{ secrets.SSH_PRODUCTION_PATH }}/scripts/deploy.sh prod ${{ secrets.SSH_PRODUCTION_PATH }}' |