Skip to content

Commit

Permalink
try self-hosted runner
Browse files Browse the repository at this point in the history
Signed-off-by: joél hawkins torres <joel@joel.fm>
  • Loading branch information
hwknsj committed Oct 14, 2024
1 parent bed409a commit 26232ff
Showing 1 changed file with 28 additions and 43 deletions.
71 changes: 28 additions & 43 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,35 @@ on: [push]

jobs:
build:
runs-on: ubuntu-latest
runs-on: self-hosted
environment: vps
steps:
- uses: actions/checkout@v1
- name: Copy repository contents via scp
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.SSH_KEY }}
source: "."
target: "/var/www/joel.fm/src"
- uses: actions/checkout@v4
- name: node install and build
uses: actions/setup-node@v4.0.4
with:
node-version: '20.x'
- run: yarn install
- run: yarn build

- name: Node
uses: actions/setup-node@v3.6.0
env:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.SSH_KEY }}
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.SSH_KEY }}
node-version: latest
- run: npm i -g yarn@latest
- run: yarn set version canary
- run: yarn
- run: yarn build
- name: Copy repository contents via scp
uses: c0c1/scp-action@v1.0
with:
host: ${{ secrets.HOST }}
user: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.SSH_KEY }}
source: './public'
remote: '/var/www/joel.fm/build'

- name: Executing remote command
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.SSH_KEY }}
script: |
cd /var/www/joel.fm/src
yarn run clean
yarn install
yarn run build
rm -rf /var/www/joel.fm/html-test
cd ..
./scripts/symlinks.sh
- name: SSH action
uses: tiyee/action-ssh@v1.0.1
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
privateKey: ${{ secrets.SSH_KEY }}
command: |
cd /var/www/joel.fm &&
rm -rf /var/www/joel.fm/html-test &&
./scripts/symlinks.sh

0 comments on commit 26232ff

Please sign in to comment.