Skip to content

Merge pull request #130 from vim/feature/contributors-guide #69

Merge pull request #130 from vim/feature/contributors-guide

Merge pull request #130 from vim/feature/contributors-guide #69

Workflow file for this run

name: Deploy Docker Images
on:
push:
branches:
- main
- development
workflow_run:
workflows:
- Build and Push Web Docker Image
- Build and Push CMS Docker Image
branches:
- development
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: setup environment file
run: |
test -f .env || cp .env.example .env
- name: copy files to server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
source: "./compose.prod.yml,./.env"
target: "~/${{ github.event.repository.name }}/"
- name: pull & start container images
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
script_stop: true
script: |
cd ~/${{ github.event.repository.name }}/
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{github.actor}} --password-stdin
docker compose -f compose.prod.yml pull
docker compose -f compose.prod.yml down
docker compose -f compose.prod.yml up -d --wait --no-build --force-recreate
docker compose -f compose.prod.yml logs -t -n 50