mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-12-25 01:11:02 +08:00
Added deploy action script
This commit is contained in:
parent
c43559cc52
commit
aebd9e74ec
2 changed files with 40 additions and 0 deletions
34
.github/workflows/deploy.yml
vendored
Normal file
34
.github/workflows/deploy.yml
vendored
Normal file
|
@ -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
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
|
@ -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"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue