Skip to content

Add environment to release action #2

Add environment to release action

Add environment to release action #2

Workflow file for this run

name: Deploy to Server
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
environment: release
steps:
- name: Checkout Repository
uses: actions/[email protected]
- name: Install Node.js
uses: actions/[email protected]
with:
node-version: '20'
- name: Install Dependencies
run: npm install
- name: Build React App
run: npm run build
- name: Configure SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy via SSH
run: |
scp -r ./dist/* [email protected]:~/project/areyouhere-web
- name: Restart Nginx
run: |
ssh [email protected] 'sudo systemctl restart nginx'