coyotte508 HF staff commited on
Commit
6ba478e
β€’
1 Parent(s): cccdf45

πŸš€ Better deploy code

Browse files
.github/workflows/deploy.yml CHANGED
@@ -9,10 +9,27 @@ jobs:
9
  deploy:
10
  runs-on: ubuntu-latest
11
  steps:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  - name: Install SSH Key
13
  uses: shimataro/ssh-key-action@v2
14
  with:
15
  key: ${{ secrets.SSH_PRIVATE_KEY }}
16
  known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
17
  - name: Deploy
18
- run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "hostnamectl && cd bergere-enchantee && git fetch && git checkout $GITHUB_SHA && pnpm install && pnpm run build && pm2 reload bergere"
 
 
 
 
9
  deploy:
10
  runs-on: ubuntu-latest
11
  steps:
12
+ - uses: actions/checkout@v3
13
+ - uses: pnpm/action-setup@v2
14
+ with:
15
+ version: 7.33.1
16
+ - uses: actions/setup-node@v3
17
+ with:
18
+ node-version: '18'
19
+ cache: 'pnpm'
20
+ - run: |
21
+ pnpm install --frozen-lockfile
22
+ echo $DOT_ENV > .env.local
23
+ pnpm build
24
+ env:
25
+ DOT_ENV: ${{ vars.DOT_ENV }}
26
  - name: Install SSH Key
27
  uses: shimataro/ssh-key-action@v2
28
  with:
29
  key: ${{ secrets.SSH_PRIVATE_KEY }}
30
  known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
31
  - name: Deploy
32
+ run: |
33
+ zip -r build.zip build
34
+ scp build.zip ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:bergere-enchantee/build.zip
35
+ ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "hostnamectl && cd bergere-enchantee && git fetch && git checkout $GITHUB_SHA && pnpm install && unzip -o build.zip && pm2 reload bergere"
.vscode/settings.json CHANGED
@@ -1,3 +1,6 @@
1
  {
2
- "editor.formatOnSave": true
 
 
 
3
  }
 
1
  {
2
+ "editor.formatOnSave": true,
3
+ "yaml.schemas": {
4
+ "https://json.schemastore.org/github-workflow.json": "file:///home/coyotte508/code/bergere-enchantee/.github/workflows/deploy.yml"
5
+ }
6
  }