Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Deploy #64

Merged
merged 93 commits into from
Feb 15, 2024
Merged
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
69c01a6
forgotten merge conflicts
Leo-Nicolle Jan 21, 2024
d3eef1c
line spacing + text algns
Leo-Nicolle Jan 22, 2024
83b3db7
line spacings
Leo-Nicolle Jan 23, 2024
d37a346
use the regexp to place arrows and splits
Leo-Nicolle Jan 24, 2024
21ef001
better form
Leo-Nicolle Jan 24, 2024
89e87a4
set size to 1
Leo-Nicolle Jan 24, 2024
2ab4212
removed wrong events, use teleport
Leo-Nicolle Jan 25, 2024
9da4835
restore inde
Leo-Nicolle Jan 25, 2024
51f550c
prevent from messing the toRaw value of styles
Leo-Nicolle Jan 26, 2024
0979d5f
fixed word index printing
Leo-Nicolle Jan 26, 2024
debb6b0
dont show arrows when -1
Leo-Nicolle Jan 26, 2024
9f2cb79
grid validity: delegate to gridhighlight and check for several arrows
Leo-Nicolle Jan 30, 2024
c7bd83b
definitions separator and definitions search fix
Leo-Nicolle Jan 30, 2024
e78cb5f
cleanup
Leo-Nicolle Feb 11, 2024
03a1b2e
do not show verif in other modes
Leo-Nicolle Feb 11, 2024
8619aca
new github action to deploy
Leo-Nicolle Feb 11, 2024
5821392
deploy from develop
Leo-Nicolle Feb 11, 2024
851efcd
cleanup
Leo-Nicolle Feb 11, 2024
2a481db
fixed deploy
Leo-Nicolle Feb 11, 2024
92f5d07
Merge branch 'develop' into text-align
Leo-Nicolle Feb 11, 2024
12ec6ee
use env
Leo-Nicolle Feb 11, 2024
05e2a3e
TO REVERT: make the action faster to test
Leo-Nicolle Feb 11, 2024
b11baa1
make it run on push
Leo-Nicolle Feb 11, 2024
be25a12
log labels
Leo-Nicolle Feb 11, 2024
f7aedd4
log labels
Leo-Nicolle Feb 11, 2024
8f55b71
use to json
Leo-Nicolle Feb 11, 2024
c054e96
cleaner check deployement type
Leo-Nicolle Feb 11, 2024
9ad3b08
Revert "TO REVERT: make the action faster to test"
Leo-Nicolle Feb 11, 2024
98cfb9f
run only on scuccess
Leo-Nicolle Feb 11, 2024
3d7af28
run only on scuccess
Leo-Nicolle Feb 11, 2024
5801b17
fixed variable usage
Leo-Nicolle Feb 11, 2024
a40784c
fixed conditions of run
Leo-Nicolle Feb 11, 2024
61fd52c
better order
Leo-Nicolle Feb 11, 2024
93c8f09
better order
Leo-Nicolle Feb 11, 2024
3607c7d
better order
Leo-Nicolle Feb 11, 2024
1841335
better order
Leo-Nicolle Feb 11, 2024
ad65c10
debug
Leo-Nicolle Feb 11, 2024
d4454cb
debug
Leo-Nicolle Feb 11, 2024
f3f1efe
debug
Leo-Nicolle Feb 11, 2024
544399d
debug
Leo-Nicolle Feb 11, 2024
4d75060
debug
Leo-Nicolle Feb 11, 2024
568bd49
debug
Leo-Nicolle Feb 11, 2024
82c0bc7
debug
Leo-Nicolle Feb 11, 2024
72fa4f2
ssh
Leo-Nicolle Feb 11, 2024
cfae227
removed test script
Leo-Nicolle Feb 11, 2024
cd37e20
use node 18
Leo-Nicolle Feb 11, 2024
c1576f6
deploy
Leo-Nicolle Feb 11, 2024
4bab3f3
use appleboy ssh action
Leo-Nicolle Feb 11, 2024
a09e699
debug
Leo-Nicolle Feb 11, 2024
4caf751
use a plugin and run all scripts on server
Leo-Nicolle Feb 11, 2024
14230f7
use a plugin and run all scripts on server
Leo-Nicolle Feb 11, 2024
9d01a15
fixed indent
Leo-Nicolle Feb 11, 2024
eeb4af5
fixed indent
Leo-Nicolle Feb 11, 2024
5be4be0
fixed typo
Leo-Nicolle Feb 11, 2024
cb83c77
use ssh
Leo-Nicolle Feb 15, 2024
a8571a6
setup know_hosts
Leo-Nicolle Feb 15, 2024
e8d23ac
set coorect rights
Leo-Nicolle Feb 15, 2024
dcc01aa
test deploy 1
Leo-Nicolle Feb 15, 2024
0924c0d
fixed paths
Leo-Nicolle Feb 15, 2024
0dc8632
fixed paths 2
Leo-Nicolle Feb 15, 2024
5a9f211
fixed path 3
Leo-Nicolle Feb 15, 2024
c6e69ed
fixed path 4
Leo-Nicolle Feb 15, 2024
eebe0af
fixed path 5
Leo-Nicolle Feb 15, 2024
9f7aef9
fixed path 6
Leo-Nicolle Feb 15, 2024
a1f2f0b
fixed path
Leo-Nicolle Feb 15, 2024
fb6aae0
fixed path 8
Leo-Nicolle Feb 15, 2024
40c915e
fixed path 9
Leo-Nicolle Feb 15, 2024
4b1830a
fixed path 10
Leo-Nicolle Feb 15, 2024
a095480
fixed path 11
Leo-Nicolle Feb 15, 2024
addab54
fixed path 12
Leo-Nicolle Feb 15, 2024
9ac796b
fixed path 13
Leo-Nicolle Feb 15, 2024
5a83146
fixed path 14
Leo-Nicolle Feb 15, 2024
1b8f85b
fixed path 15
Leo-Nicolle Feb 15, 2024
7543d6f
fixed path 16
Leo-Nicolle Feb 15, 2024
079ffcc
fixed path 17
Leo-Nicolle Feb 15, 2024
1c9ee6e
fixed path 17
Leo-Nicolle Feb 15, 2024
e723b05
fixed path 18
Leo-Nicolle Feb 15, 2024
2331557
fixed path 18
Leo-Nicolle Feb 15, 2024
f21de22
fixed path 18
Leo-Nicolle Feb 15, 2024
ec0bf7d
fixed path 19
Leo-Nicolle Feb 15, 2024
83f5363
fixed path 20
Leo-Nicolle Feb 15, 2024
3ce8d44
fixed path 21
Leo-Nicolle Feb 15, 2024
da4908b
fixed path 22
Leo-Nicolle Feb 15, 2024
56e0fcc
fixed path 22
Leo-Nicolle Feb 15, 2024
969969f
fixed path 23
Leo-Nicolle Feb 15, 2024
d68bf00
fixed path 24
Leo-Nicolle Feb 15, 2024
bfb5ae3
fixed path 25
Leo-Nicolle Feb 15, 2024
f0690c2
fixed path 26
Leo-Nicolle Feb 15, 2024
69139e2
fixed path 27
Leo-Nicolle Feb 15, 2024
61e3e08
fixed path 28
Leo-Nicolle Feb 15, 2024
60b358c
fixed path 29
Leo-Nicolle Feb 15, 2024
b1bacca
restore checks
Leo-Nicolle Feb 15, 2024
76a5457
use original folder
Leo-Nicolle Feb 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 43 additions & 30 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,70 @@ on:
branches:
- develop

env:
PUBLIC: "~/motsflex/public"
ASSETS: "$PUBLIC/assets"
INDEX_HTML: "$PUBLIC/index.html"
DICOS: "~/dicos"
SERVER: "~/motsflex/server.js"
SSH_TARGET: ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_HOST }}

jobs:
deploy:
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@v2
- name: Setup ssh
run: |
mkdir -p ~/.ssh/ && touch ~/.ssh/known_hosts
ssh-keyscan ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts
echo "${{ secrets.SSH_PRIVATE_KEY }}" > $KEY
chmod 600 $KEY

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "16"
node-version: "18"

- name: Determine Deployment Type
if: ${{ success() }}
run: |
echo "DEPLOY_ASSETS=${{ contains(toJson(github.event.pull_request.labels.*.name), 'deploy:assets') }}" >> $GITHUB_ENV
echo "DEPLOY_SERVER=${{ contains(toJson(github.event.pull_request.labels.*.name), 'deploy:server') }}" >> $GITHUB_ENV
echo "DEPLOY_CLIENT=${{ contains(toJson(github.event.pull_request.labels.*.name), 'deploy:client') }}" >> $GITHUB_ENV
echo "PUBLIC=$DIR/public" >> $GITHUB_ENV
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
if [[ ${{env.DEPLOY_ASSETS}} ='false' && ${{env.DEPLOY_SERVER}} ='false' && ${{env.DEPLOY_CLIENT}} ='false' ]]; then
exit 1;
fi

- name: Install Dependencies
run: npm install
if: ${{ success() }}
run: npm ci

- name: Build
if: ${{ success() }}
run: npm run build

- name: Check deployement type
id: deployment_type
run: |
echo "::set-output name=deploy_assets::${{ contains(github.event.pull_request.labels.*.name, 'deploy:assets') }}"
echo "::set-output name=deploy_server::${{ contains(github.event.pull_request.labels.*.name, 'deploy:server') }}"
echo "::set-output name=deploy_client::${{ contains(github.event.pull_request.labels.*.name, 'deploy:client') }}"

- name: Deploy
if: steps.determine_deployment.outputs.deployment_type == 'tags'
if: ${{ success() }}
run: |
echo "Github resfs: $GITHUB_REF"
if [[ steps.deployment_type.outputs.deploy_assets == 'true' ]]; then
if [ "$DEPLOY_ASSETS" = 'true' ]; then
echo "Deploying JS assets"
ssh $SSH_TARGET "rm -rf $ASSETS && mkdir -p $ASSETS"
scp -r dist/public/assets $SSH_TARGET:$ASSETS
scp -r dist/public/index.html $SSH_TARGET:$INDEX_HTML
ssh -i $KEY $TARGET "rm -rf $ASSETS && mkdir -p $ASSETS"
scp -i $KEY -r dist/public/assets/* "$TARGET:$ASSETS"
scp -i $KEY -r dist/public/index.html "$TARGET:$INDEX_HTML"
fi
if [[ steps.deployment_type.outputs.deploy_client == 'true' ]]; then
if [ "$DEPLOY_CLIENT" = 'true' ]; then
echo "Deploying full client"
ssh $SSH_TARGET "rm -rf $PUBLIC && mkdir -p $PUBLIC"
scp -r dist/public $SSH_TARGET:$PUBLIC
ssh $SSH_TARGET "cp $DICOS/*.zip $ASSETS"
ssh -i $KEY $TARGET "rm -rf $PUBLIC && mkdir -p $PUBLIC"
scp -i $KEY -r dist/public/* "$TARGET:$PUBLIC"
ssh -i $KEY $TARGET "cp $DICOS/*.zip $PUBLIC/assets"
fi
if [[ steps.deployment_type.outputs.deploy_server == 'true' ]]; then
if [ "$DEPLOY_SERVER" = 'true' ]; then
echo "Deploying server code"
scp -r dist/server.js $SSH_TARGET:$SERVER
scp -i $KEY -r dist/server.js "$TARGET:$SERVER"
fi
- name: Cleanup
run: "rm -f $KEY && rm -rf ~/.ssh"