add deploy workflow
This commit is contained in:
1 parent
a521d0062f
commit
6423dee1fc
1 file changed
+47
@@ -0,0 +1,47 @@
|
||||
name: CD
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ['CI']
|
||||
types:
|
||||
- completed
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@master
|
||||
with:
|
||||
name: build
|
||||
path: build/
|
||||
|
||||
- name: Create tarball
|
||||
run: |
|
||||
tar czvf build.tgz build/
|
||||
|
||||
- name: Copy via ssh
|
||||
uses: appleboy/scp-action@master
|
||||
with:
|
||||
host: ${{ secrets.DEPLOY_HOST }}
|
||||
port: 2280
|
||||
username: ${{ secrets.DEPLOY_USERNAME }}
|
||||
key: ${{ secrets.DEPLOY_KEY }}
|
||||
source: 'build.tgz'
|
||||
target: '~/builds'
|
||||
|
||||
- name: Run ansible
|
||||
uses: appleboy/ssh-action@master
|
||||
with:
|
||||
host: ${{ secrets.DEPLOY_HOST }}
|
||||
port: 2280
|
||||
username: ${{ secrets.DEPLOY_USERNAME }}
|
||||
key: ${{ secrets.DEPLOY_KEY }}
|
||||
script: |
|
||||
whoami
|
||||
pwd
|
||||
ls -la
|
||||
Reference in new issue
Block a user