-
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.
- Loading branch information
1 parent
73a702f
commit 8542f5f
Showing
7 changed files
with
26 additions
and
142 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
name: Update Production | ||
name: Push to Pages | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
branches: [main] | ||
|
||
jobs: | ||
update-production: | ||
deploy: | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
@@ -16,61 +19,17 @@ jobs: | |
with: | ||
node-version: '16' | ||
|
||
- name: SSH into server and deploy | ||
uses: appleboy/[email protected] | ||
with: | ||
host: ${{ secrets.SERVER_HOST }} | ||
username: ${{ secrets.SERVER_USERNAME }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
port: 22 | ||
script: | | ||
cd /home/cpplus/client | ||
git pull --recurse-submodules | ||
npm install | ||
npm run build | ||
create-archive: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Install zip | ||
uses: montudor/action-zip@v1 | ||
|
||
- name: Checkout repository and submodules | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.MEDIA_KEY }} | ||
submodules: recursive | ||
path: client | ||
|
||
- name: Remove .git folder to reduce file size | ||
run: rm -rf client/.git | ||
|
||
- name: Checkout server | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: clubpenguinplus/server | ||
token: ${{ secrets.MEDIA_KEY }} | ||
path: server | ||
|
||
- name: Get version | ||
id: package-version | ||
uses: martinbeentjes/npm-get-version-action@main | ||
with: | ||
path: 'client' | ||
|
||
- name: Create archive folder | ||
run: mkdir -p archive | ||
- run: npm install | ||
|
||
- name: Zip files | ||
run: zip -qq -r archive/${{ steps.package-version.outputs.current-version }}.zip server client | ||
- run: npm run build | ||
|
||
- name: Upload archive | ||
uses: sharapeco/lftp-mirror-action@main | ||
- name: Setup Pages | ||
uses: actions/configure-pages@v5 | ||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
host: ${{ secrets.SERVER_HOST }} | ||
port: 22 | ||
username: ${{ secrets.SERVER_USERNAME }} | ||
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
local_path: './archive' | ||
remote_path: '/home/cpplus/archive' | ||
# Upload entire repository | ||
path: '.' | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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