Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo-Nicolle committed Feb 15, 2024
2 parents 05c3c44 + c7656f0 commit f497f8e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 26 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,22 @@ name: Deploy

on:
pull_request:
branches:
- develop
types: [closed]

jobs:
deploy:
if: github.event.pull_request.merged == true || github.ref_name == 'master'
runs-on: ubuntu-latest
env:
TARGET: ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}
KEY: /tmp/private-key
DIR: ~/motsflex
DICOS: ~/dicos
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true
steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v2
with:
ref: develop
ref: "develop"
- name: Setup ssh
run: |
mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts
Expand All @@ -41,7 +40,11 @@ jobs:
echo "SERVER=${{ env.DIR }}/server.js" >> $GITHUB_ENV
echo "ASSETS=${{ env.DIR }}/public/assets" >> $GITHUB_ENV
echo "INDEX_HTML=${{ env.DIR }}/public/index.html" >> $GITHUB_ENV
<<<<<<< HEAD
if [[ ${{env.DEPLOY_ASSETS}} ='false' && ${{env.DEPLOY_SERVER}} ='false' && ${{env.DEPLOY_CLIENT}} ='false' ]]; then
=======
if [[ $DEPLOY_ASSETS == 'false' && $DEPLOY_SERVER == 'false' && $DEPLOY_CLIENT == 'false' ]]; then
>>>>>>> @{-1}
exit 1;
fi

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ build/
dist/
docs/.vuepress/.cache
docs/.vuepress/.temp
scripts/api-key.mjs
scripts/api-key.mjs
scripts/plausible-key
25 changes: 5 additions & 20 deletions scripts/postbuild.mjs
Original file line number Diff line number Diff line change
@@ -1,29 +1,14 @@
import rimraf from "rimraf";
import { mkdir } from 'fs/promises'
import { mkdir } from 'fs/promises';
import fs from "fs-extra";
import path from 'path';
import { tmpdir } from 'os';

const outFolder = 'dist/';

// function buildjs() {
// const outDir = 'dist/';
// const tmpDir = path.resolve(tmpdir(), `mots-flex-js${Date.now()}`);
// return fs.mkdir(outDir, { recursive: true })
// .then(() => Promise.all([
// fs.copy("build/public", path.resolve(tmpDir, "public")),
// fs.copy("build/dico", path.resolve(tmpDir, "dico")),
// fs.copy("build/server.js", path.resolve(tmpDir, "server.js")),
// ]))
// .then(() => wz.mZip.zipFolder(tmpDir, 'dist/mots-flex-js.zip'))
// }


Promise.resolve()
.then(() => rimraf(outFolder))
.then(() => mkdir(outFolder))
.then(() => fs.copy('server/dist', outFolder))
.then(() => fs.copy('client/dist', path.resolve(outFolder, 'public')))
.then(() => rimraf(outFolder))
.then(() => mkdir(outFolder))
.then(() => fs.copy('server/dist', outFolder))
.then(() => fs.copy('client/dist', path.resolve(outFolder, 'public')))



Expand Down

0 comments on commit f497f8e

Please sign in to comment.