Skip to content

Commit

Permalink
added CI/CD for server
Browse files Browse the repository at this point in the history
  • Loading branch information
CrackerakiUA committed Nov 30, 2024
1 parent 3ed1938 commit a6f0133
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
40 changes: 40 additions & 0 deletions .github/workflows/waw-default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Sync waw default project to waw-default

on:
push:
paths:
- 'server/**' # Trigger only on changes in the server folder

jobs:
sync-waw:
runs-on: ubuntu-latest

steps:
- name: Checkout source repository
uses: actions/checkout@v3

- name: Set up SSH
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Sync waw default folder to waw-default
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git clone [email protected]:WebArtWork/waw-default.git waw-default
rm -rf waw-default/*
cp -r server/* waw-default/
cd waw-default
git add .
git commit -m "Update files from source repository" || echo "No changes to commit"
git push --force
- name: Clean up SSH
run: |
rm -f ~/.ssh/id_rsa
rm -f ~/.ssh/known_hosts
2 changes: 1 addition & 1 deletion .github/workflows/wjst-default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git clone [email protected]:WebArtWork/wjst-default.git wjst-default
rm -rf wjst-default/*
cp -r client/* wjst-default/
cp -r template/* wjst-default/
cd wjst-default
echo "wjst-default.webart.work" > CNAME
git add .
Expand Down
2 changes: 2 additions & 0 deletions template/readme.MD
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ You will need to install [Node.js](https://nodejs.org/en) and waw globally
```sh
npm i -g waw
```

## Development
To start coding, you can simply run command
```sh
waw
```

## Production github pages
If you wanna use github domain, you simply have to replace prefix into github repo name. If you will configure a custom domain, you will need to add `"base": "/"` in `config.json` file.

0 comments on commit a6f0133

Please sign in to comment.