Skip to content

feat: update nature juridique #67

feat: update nature juridique

feat: update nature juridique #67

Workflow file for this run

name: Deploy
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy-staging:
name: Deploy - staging
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Set up SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ./deploy.key
sudo chmod 600 ./deploy.key
ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts
shell: bash
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_MACHINE_USER_PRIVATE_KEY}}
SSH_HOST: ${{ secrets.SSH_HOST_STAGING }}
- name: Deploy to production
run: ssh -i ./deploy.key www-data@$SSH_HOST 'sh /opt/apps/rncs-api-proxy/rncs-api-proxy-deploy.sh'
env:
SSH_HOST: ${{ secrets.SSH_HOST_STAGING }}
- name: Notify staging failure only
if: failure()
uses: ./.github/actions/notify
with:
message: '🚨 ${{ github.event.repository.name }} : deploy to staging failed'
hook: ${{ secrets.TCHAP_HOOK }}
id: ${{ secrets.TCHAP_ROOM_ID }}
deploy-production:
name: Deploy - production
runs-on: ubuntu-latest
needs: [deploy-staging]
steps:
- uses: actions/checkout@v3
- name: Set up SSH
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ./deploy.key
sudo chmod 600 ./deploy.key
ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts
shell: bash
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_MACHINE_USER_PRIVATE_KEY}}
SSH_HOST: ${{ secrets.SSH_HOST_PRODUCTION }}
- name: Deploy to production
run: ssh -i ./deploy.key www-data@$SSH_HOST 'sh /opt/apps/rncs-api-proxy/rncs-api-proxy-deploy.sh'
env:
SSH_HOST: ${{ secrets.SSH_HOST_PRODUCTION }}
- name: Notify staging failure only
if: failure()
uses: ./.github/actions/notify
with:
message: '🚨 ${{ github.event.repository.name }} : deploy to production failed'
hook: ${{ secrets.TCHAP_HOOK }}
id: ${{ secrets.TCHAP_ROOM_ID }}
- name: Notify deploy succes
if: success()
uses: ./.github/actions/notify
with:
message: '✅ ${{ github.event.repository.name }} : successfully deploy to staging & production'
hook: ${{ secrets.TCHAP_HOOK }}
id: ${{ secrets.TCHAP_ROOM_ID }}