move deploy

This commit is contained in:
Mateusz Pstrucha committed 2023-03-26 11:10:16 +02:00
1 parent 6423dee1fc
commit dc39faf8ce
2 files changed
+37 -47

No files matched your search

+37
View File
@@ -33,3 +33,40 @@ jobs:
with:
name: build
path: build/
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
-47
View File
@@ -1,47 +0,0 @@
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