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: "Deploy Static Files to Server" | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
concurrency: | |
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" | |
cancel-in-progress: false | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: SSH CREDENTIALS | |
steps: | |
- name: "Checking Out" | |
uses: actions/checkout@v3 | |
- name: Setting Up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "21.x" | |
- name: Installing dependencies | |
run: yarn | |
- name: Generating Static Files | |
run: yarn build | |
- name: Deploy to Server | |
uses: easingthemes/[email protected] | |
with: | |
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} | |
REMOTE_HOST: ${{ secrets.REMOTE_HOST }} | |
REMOTE_USER: ${{ secrets.REMOTE_USER }} | |
REMOTE_PORT: ${{ secrets.REMOTE_PORT }} | |
SOURCE: "opensource/" | |
TARGET: ${{ secrets.REMOTE_TARGET }} | |
SCRIPT_BEFORE: ls |