From 8542f5f1de252daa4df233b6aa3169cbf05bb088 Mon Sep 17 00:00:00 2001 From: sahmyool <67554336+sahmyooI@users.noreply.github.com> Date: Mon, 3 Jun 2024 22:14:15 +0100 Subject: [PATCH] pages? --- .github/workflows/beta.yml | 47 --------------------- .github/workflows/check-pr.yml | 28 ------------- .github/workflows/main.yml | 75 ++++++++-------------------------- client/.gitignore | 4 +- index.html | 2 +- package-lock.json | 8 ++-- webpack.config.js | 4 +- 7 files changed, 26 insertions(+), 142 deletions(-) delete mode 100644 .github/workflows/beta.yml delete mode 100644 .github/workflows/check-pr.yml diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml deleted file mode 100644 index 1585f7de..00000000 --- a/.github/workflows/beta.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Update Development - -on: - push: - branches: '**-beta' - -jobs: - update-development: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - uses: actions/setup-node@v2 - with: - node-version: '16' - - - name: SSH into server and deploy - uses: appleboy/ssh-action@v0.1.9 - if: contains(github.event.head_commit.message, '[debug]') - with: - host: ${{ secrets.SERVER_HOST }} - username: ${{ secrets.SERVER_USERNAME }} - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: 22 - script: | - cd /home/cpplus/betaclient - git checkout ${{ github.ref_name }} - git pull --recurse-submodules - npm install - npm run build-dev - - - name: SSH into server and deploy - uses: appleboy/ssh-action@v0.1.9 - if: (!contains(github.event.head_commit.message, '[debug]')) - with: - host: ${{ secrets.SERVER_HOST }} - username: ${{ secrets.SERVER_USERNAME }} - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: 22 - script: | - cd /home/cpplus/betaclient - git checkout ${{ github.ref_name }} - git pull --recurse-submodules - npm install - npm run build \ No newline at end of file diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml deleted file mode 100644 index 18d18878..00000000 --- a/.github/workflows/check-pr.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Check PR - -on: - pull_request: - branches: [master] - -jobs: - check-pr: - runs-on: ubuntu-latest - - steps: - - name: Checkout updated version - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.ref }} - - - name: Checkout current version - uses: actions/checkout@v2 - with: - ref: 'master' - path: currentversion - - - uses: actions/setup-node@v2 - with: - node-version: '16' - - - name: Check version update - run: npm run check-version diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1848efbf..ef45ff7a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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/ssh-action@v0.1.9 - 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 diff --git a/client/.gitignore b/client/.gitignore index 541ed823..c4d17560 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -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 diff --git a/index.html b/index.html index c6c19e36..43246704 100644 --- a/index.html +++ b/index.html @@ -39,7 +39,7 @@ diff --git a/package-lock.json b/package-lock.json index bd0e261d..8610ea56 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "clubpenguinplus", - "version": "1.0.5", + "name": "igloo-sandbox", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "clubpenguinplus", - "version": "1.0.5", + "name": "igloo-sandbox", + "version": "1.0.0", "dependencies": { "crypto-js": "^4.2.0", "devtools-detect": "^4.0.1", diff --git a/webpack.config.js b/webpack.config.js index 6986c7f9..3e858b81 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -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 : { @@ -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