Deploy #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
workflow_run: | |
workflows: ["Build and Push Falak Image"] | |
types: | |
- completed | |
workflow_dispatch: | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
if: | | |
github.event_name == 'workflow_dispatch' || | |
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Run whoami through ssh :D | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.DEPLOY_HOST }} | |
username: deploy | |
key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }} | |
port: 22 | |
passphrase: ${{ secrets.SSH_KEY_PASSPHRASE }} | |
script: whoami | |
- name: Verify host | |
run: | | |
mkdir -p ~/.ssh | |
ssh-keyscan -H ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts | |
- name: Create deploy docker context | |
run: | | |
docker context create deploy --docker host=ssh://deploy@${{ secrets.DEPLOY_HOST }} | |
docker context use deploy | |
docker ps -a |