Skip to content

fix bug

fix bug #40

Workflow file for this run

name: Deploy for production
on:
push:
branches: ["v2"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: saturday
IMAGE_NAME_FULL: ghcr.io/nbtca/saturday
jobs:
v2_Deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
with:
ref: "v2"
- name: Login DockerHub
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push to DockerHub
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
no-cache: true
# target: deploy
push: true
platforms: linux/amd64
tags: |
${{ env.IMAGE_NAME_FULL }}:v2
${{ env.IMAGE_NAME_FULL }}:latest
- name: ssh pipelines
uses: cross-the-world/ssh-pipeline@master
with:
host: ${{ secrets.REMOTE_HOST }}
user: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.ACCESS_TOKEN }}
connect_timeout: 10s
script: |
cd /home/nbtca/weekend/saturday_prod
docker compose stop && docker compose rm -f
docker compose pull
docker compose up -d