Skip to content

Merge pull request #46 from computebender/45-improve-about-me-page-de… #18

Merge pull request #46 from computebender/45-improve-about-me-page-de…

Merge pull request #46 from computebender/45-improve-about-me-page-de… #18

Workflow file for this run

name: Build and Deploy
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/${{ github.repository_owner }}/benmunrome:latest
deploy:
runs-on: ubuntu-latest
needs: build-and-push
steps:
- name: Deploy to VPS
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DO_HOST }}
username: ${{ secrets.DO_USER }}
key: ${{ secrets.DO_PRIVATE_KEY }}
script: |
cd /var/www/benmunrome
git pull origin main
docker compose down
docker compose pull
docker compose up -d