Skip to content

Commit

Permalink
pages?
Browse files Browse the repository at this point in the history
  • Loading branch information
sky-is-winning committed Jun 3, 2024
1 parent 73a702f commit 8542f5f
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 142 deletions.
47 changes: 0 additions & 47 deletions .github/workflows/beta.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/check-pr.yml

This file was deleted.

75 changes: 17 additions & 58 deletions .github/workflows/main.yml
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:
Expand All @@ -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
4 changes: 2 additions & 2 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scripts/client/clubpenguinplus.js
scripts/client/clubpenguinplus.min.js
scripts/client/igloo-sandbox.js
scripts/client/igloo-sandbox.min.js
media/game_configs/
*.bak
*.zip
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<script src="/client/scripts/lib/webfont.js"></script>
<script>
var script = document.createElement("script");
script.src = `/client/scripts/client/clubpenguinplus.min.js?v=${Date.now().toString()}`, document.getElementsByTagName("HEAD")[0].appendChild(script)
script.src = `/client/scripts/client/igloo-sandbox.min.js?v=${Date.now().toString()}`, document.getElementsByTagName("HEAD")[0].appendChild(script)
</script>
</head>

Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ let config = {
mode: 'development',
entry: './src/Game.js',
output: {
filename: 'clubpenguinplus.js',
filename: 'igloo-sandbox.js',
path: path.resolve(__dirname, 'client/scripts/client')
},
optimization : {
Expand Down Expand Up @@ -70,7 +70,7 @@ let config = {
}

module.exports = (env, argv) => {
config.output.filename = 'clubpenguinplus.min.js'
config.output.filename = 'igloo-sandbox.min.js'
if (argv.mode === 'production') {
config.optimization.minimize = true

Expand Down

0 comments on commit 8542f5f

Please sign in to comment.