Skip to content

fix auth

fix auth #28

name: Deploy for production
on:
push:
branches: ["main"]
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
- 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: appleboy/ssh-action@v1.0.0
env:
BRANCH_NAME: ${{ github.ref_name }}
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USER }}
key: ${{ secrets.ACCESS_TOKEN }}
script: |
cd /home/nbtca/stacks/weekend
docker stack deploy -c ./compose.yaml weekend