Skip to content

Commit

Permalink
Added deploy action script
Browse files Browse the repository at this point in the history
  • Loading branch information
andris9 committed Mar 31, 2023
1 parent c43559c commit aebd9e7
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/deploy.yml
@@ -0,0 +1,34 @@
on:
push:
branches:
- master

name: Deploy test instance

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_KEY }}
known_hosts: ${{ secrets.KNOWN_HOSTS }}

- name: Deploy to server
env:
TARGET_HOST_02: srv-04.srv.dev
NODE_ENV: production
SERVICE_NAME: wildduck
id: deploy
run: |
echo $GITHUB_SHA > commit.txt
npm install --omit=dev
tar czf /tmp/${SERVICE_NAME}.tar.gz --exclude .git .
scp -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" /tmp/${SERVICE_NAME}.tar.gz deploy@${TARGET_HOST_02}:
ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" deploy@$TARGET_HOST_02 "/opt/deploy.sh ${SERVICE_NAME}"
6 changes: 6 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,6 @@
{
"yaml.schemas": {
"https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml",
"https://json.schemastore.org/github-workflow.json": "file:///Users/andris/Projects/wildduck/.github/workflows/deploy.yml"
}
}

0 comments on commit aebd9e7

Please sign in to comment.