Skip to content

permission-engine/src: update module dependency #39

permission-engine/src: update module dependency

permission-engine/src: update module dependency #39

Workflow file for this run

name: Deploy to Prod
on:
push:
branches:
- prod
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Display commit info
- name: Display commit info
run: |
echo "Commit Hash: ${{ github.sha }}"
echo "Commit Author: ${{ github.event.head_commit.author.name }}"
echo "Commit Message: ${{ github.event.head_commit.message }}"
# Step 3: Set up SSH to connect to server
- name: Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add server to known_hosts
run: |
ssh-keyscan -H ${{ secrets.PROD_SERVER_IP }} >> ~/.ssh/known_hosts
# Step 4: Deploy the application
- name: Deploy to Prod Server
run: |
ssh ${{ secrets.PROD_SERVER_USER }}@${{ secrets.PROD_SERVER_IP }} "cd /mnt/ptc/permissioning-city-engine && git pull origin prod && ./scripts/deploy.sh"
# Step 5: Send results to Slack
- name: Send success notification to Slack
if: success()
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"Deployment triggered by commit: `'"${{ github.sha }}"'` \nAuthor: '"${{ github.event.head_commit.author.name }}"' \nMessage: '"${{ github.event.head_commit.message }}"' \n\nResult: Deployment succeeded :white_check_mark:"}' ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Send failure notification to Slack
if: failure()
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":"Deployment triggered by commit: `'"${{ github.sha }}"'` \nAuthor: '"${{ github.event.head_commit.author.name }}"' \nMessage: '"${{ github.event.head_commit.message }}"' \n\nResult: Deployment failed :x:"}' ${{ secrets.SLACK_WEBHOOK_URL }}