-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: build and copy files to econosim.org
closes #4
- Loading branch information
1 parent
ddec6ff
commit f0511e2
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Build and Copy to Server | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-and-copy: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v4 | ||
- name: Set up Node.js with caching | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
cache-dependency-path: package-lock.json | ||
- name: Configure SSH | ||
env: | ||
RSA_PRIVATE_KEY: ${{ secrets.SSH_RSA_PRIVATE_KEY }} | ||
KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }} | ||
run: | | ||
mkdir -p ~/.ssh | ||
echo "$RSA_PRIVATE_KEY" > ~/.ssh/id_rsa | ||
chmod 600 ~/.ssh/id_rsa | ||
echo "$KNOWN_HOSTS" > ~/.ssh/known_hosts | ||
chmod 600 ~/.ssh/known_hosts | ||
- name: Install npm dependencies | ||
run: | | ||
npm install | ||
- name: Build the React app | ||
run: | | ||
npm run build | ||
- name: Remove old files from the server | ||
run: | | ||
ssh [email protected] rm -frv /www/econosim.org/econosim.org/static | ||
- name: Copy new files to the server | ||
run: | | ||
scp \ | ||
-r \ | ||
build/* \ | ||
[email protected]:/www/econosim.org/econosim.org |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"files.autoSave": "onFocusChange", | ||
"editor.formatOnPaste": true, | ||
"editor.formatOnSave": true | ||
} |