Skip to content

fix: handle unauthorized request #41

fix: handle unauthorized request

fix: handle unauthorized request #41

Workflow file for this run

name: Development
on:
push:
branches:
- development
jobs:
deploy:
name: Deploy to Zuserver
runs-on: ubuntu-latest
environment: development
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Deploy
env:
SERVER_HOST: ${{ secrets.ZUSERVER_HOST }}
SERVER_SSH_PRIVATE_KEY: ${{ secrets.ZUSERVER_SSH_PRIVATE_KEY }}
SCRIPT: ${{ vars.ZUSERVER_DEPLOY_COMMAND }}
run: |
mkdir -p ~/.ssh
ssh-keyscan -H $SERVER_HOST >> ~/.ssh/known_hosts
echo "$SERVER_SSH_PRIVATE_KEY" > ~/.ssh/id_private_key
chmod 600 ~/.ssh/id_private_key
ssh -i ~/.ssh/id_private_key root@$SERVER_HOST "$SCRIPT"
- name: Notify Discord
if: ${{ !cancelled() }}
run: |
curl -X POST -H "Content-Type: application/json" \
-d '{
"content": "**## [DEPLOYMENT ${{ job.status == 'success' && 'SUCCESS' || 'FAILED' }}]**\nProject: **Fisdasweb Admin**\nBranch: `${{ github.ref_name }}`\nJob: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}' ${{ secrets.DISCORD_WEBHOOK }}
# deploy-to-vercel:
# uses: ./.github/workflows/vercel-deploy.yml
# with:
# environment: development
# vercel-environment: preview
# working-directory: .
# secrets: inherit