Skip to content

Merge pull request #256 from letehaha/feat/dashboard-period-selector #122

Merge pull request #256 from letehaha/feat/dashboard-period-selector

Merge pull request #256 from letehaha/feat/dashboard-period-selector #122

name: Docker Image CI
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
token: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }}
- id: docker-build
uses: ./.github/actions/docker-build
with:
vps-host: ${{ secrets.VPS_HOST }}
vue-app-api-ver: ${{ secrets.VUE_APP_API_VER }}
docker-hub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
docker-hub-access-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
push: 'true'
- name: Image digest
run: echo ${{ steps.docker-build.outputs.docker-build-digest }}
- name: Actualize docker images on VPS
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USERNAME }}
key: ${{ secrets.VPS_SSH_KEY }}
passphrase: ${{ secrets.VPS_SSH_KEY_PASSPHRASE }}
script_stop: true
script: |
cd ${{ secrets.VPS_PROJECT_PATH }}
# Pull the latest image
docker-compose pull
# Start the new containers without dependencies, so there will be almost
# no downtime
docker-compose up -d --no-deps