Merge pull request #4 from insektionen/development #12
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: Build & Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Build container | |
id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
load: true | |
tags: insektionen/kistan-doc:latest | |
- name: Export container | |
run: docker save insektionen/kistan-doc:latest | gzip > kistan-doc_latest.tar.gz | |
- name: Copy to Server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
port: 22 | |
source: "kistan-doc_latest.tar.gz" | |
target: "~/" | |
- name: Import and start on Server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
port: 22 | |
script: docker load < kistan-doc_latest.tar.gz && cd kistan-doc && docker-compose up -d |