42 lines
1.1 KiB
YAML
42 lines
1.1 KiB
YAML
name: "Deploy to VPS"
|
|
|
|
on:
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
jobs:
|
|
build-and-deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out the repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: DockerHub login
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build and push to DockerHub
|
|
run: |
|
|
docker build -t devarifhossain/retroui:1.2.0 ./
|
|
docker push devarifhossain/retroui:1.2.0
|
|
|
|
# - name: Set up SSH
|
|
# uses: webfactory/ssh-agent@v0.9.0
|
|
# with:
|
|
# ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
|
|
# - name: Add VPS to known_hosts
|
|
# run: |
|
|
# ssh-keyscan -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts
|
|
|
|
# - name: Deploy to VPS
|
|
# run: |
|
|
# ssh ${{ secrets.VPS_USERNAME }}@${{ secrets.VPS_HOST }} "cd /root/retroui && git pull && docker compose -f ./infra/docker-compose.prod.yml up web --build -d"
|