Skip to content

Commit

Permalink
update deploy and bump v
Browse files Browse the repository at this point in the history
  • Loading branch information
dskvr committed Apr 18, 2024
1 parent 32ec404 commit f1da047
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: deploy
on:
- push
push
jobs:
build-and-deploy:
runs-on: ubuntu-latest
Expand All @@ -15,42 +15,39 @@ jobs:
restore-keys: |
${{ runner.os }}-npm-
- uses: pnpm/action-setup@v3
with:
version: 8
# run_install: |
# - recursive: true
# args: [--frozen-lockfile, --strict-peer-dependencies]
# - args: [--global, prettier, typescript]

- name: install
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
pnpm install
yarn install
- name: build
run: pnpm build
run: yarn build

- name: get-npm-version
if: github.ref == 'refs/heads/main'
id: package-version
uses: martinbeentjes/[email protected]

- name: Install SSH Key
if: github.ref == 'refs/heads/main'
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}

- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hostsa
if: github.ref == 'refs/heads/main'
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts

- name: Deploy with rsync
if: github.ref == 'refs/heads/main'
run: |
TARGET_DIR="/var/www/html/${{ steps.package-version.outputs.current-version}}"
rsync -a --rsync-path="mkdir -p $TARGET_DIR && rsync" ./build/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:$TARGET_DIR
- name: Update symlink
if: github.ref == 'refs/heads/main'
run: |
sudo rm -f /var/www/html/latest
sudo ln -sf /var/www/html/${{ steps.package-version.outputs.current-version}} /var/www/html/latest
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "myrelay.site",
"type": "module",
"version": "0.1.1",
"version": "0.2.0",
"main": "index.js",
"repository": "[email protected]:sandwichfarm/myrelay.site.git",
"author": "dskvr <[email protected]>",
Expand Down

0 comments on commit f1da047

Please sign in to comment.