Skip to content

didn't work

didn't work #4

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_PAT }}
- name: Build and push Docker image
run: |
echo "${{ secrets.GH_PAT }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
GITHUB_TOKEN=${{ secrets.GH_PAT }} docker buildx build --secret id=GITHUB_TOKEN -t ghcr.io/loftwah-demo/pirate_app/pirateapp:latest --push .
- name: Deploy to droplet
uses: appleboy/ssh-action@master
with:
host: 170.64.189.40
username: root
key: ${{ secrets.DROPLET_SSH_PRIVATE_KEY }}
script: |
docker-compose -f /root/docker-compose.prod.yml --env-file /root/.env down
docker-compose -f /root/docker-compose.prod.yml --env-file /root/.env pull
docker-compose -f /root/docker-compose.prod.yml --env-file /root/.env up -d