Update events.js #70
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: Production Deployment | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: deployment | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20.10.0' | |
- name: Install dependencies | |
run: npm install | |
- name: Lint and build | |
run: | | |
npm run build | |
sed -i 's/\"\//\".\//g' ./out/*.html | |
- name: Install sshpass | |
run: sudo apt-get update && sudo apt-get install -y sshpass | |
- name: Publish to server | |
run: sshpass -p "${{ secrets.PASSWORD }}" scp -o StrictHostKeyChecking=no -r ./out/* ${{ secrets.USERNAME }}@${{ secrets.SSH_SERVER }}:public_html/site/ | |
- name: Success | |
run: echo "Deployed successfully!" |