Skip to content

debug PEM file content #8

debug PEM file content

debug PEM file content #8

Workflow file for this run

name: Deploy to EC2
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20: true
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: npm install
- name: Build the app
run: npm run build
- name: Decode SSH Key
run: echo "${{ secrets.EC2_SSH_KEY }}" | base64 --decode > my-wesite-server.pem
- name: Set permissions
run: chmod 600 my-wesite-server.pem
- name: Debug PEM file content
run: cat my-wesite-server.pem
- name: Copy files to EC2
uses: appleboy/[email protected]
with:
host: ${{ secrets.EC2_HOST }}
username: ${{ secrets.EC2_USER }}
key: my-wesite-server.pem
port: 22
source: "build/*"
target: "/var/www/html/"
- name: Restart Nginx
run: |
ssh -i my-wesite-server.pem -o StrictHostKeyChecking=no ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} "sudo systemctl reload nginx"