Saliovin is building 9338678a471eec9d2aa50b403ebd49ff73b18e70 #11
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
run-name: ${{ github.actor }} is building ${{ github.sha }} | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
Deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Checkout GitHub Action" | |
uses: actions/checkout@v4 | |
- name: "Login to GitHub Container Registry" | |
uses: docker/login-action@v1 | |
with: | |
registry: ghcr.io | |
username: ${{github.actor}} | |
password: ${{secrets.GITHUB_TOKEN}} | |
- name: "Build and Push Image" | |
run: | | |
docker build -t typetoast/frontend --build-arg NEXT_PUBLIC_BASE_API_URL=${{secrets.NEXT_PUBLIC_BASE_API_URL}} . | |
docker tag typetoast/frontend:latest ghcr.io/saliovin/typetoast/frontend:latest | |
docker push ghcr.io/saliovin/typetoast/frontend:latest | |
- name: Restarting Docker Compose Through SSH | |
uses: appleboy/ssh-action@v1.0.3 | |
with: | |
host: ${{ secrets.HOST }} | |
username: ${{ secrets.USERNAME }} | |
key: ${{ secrets.KEY }} | |
script: sudo docker compose pull typetoast-frontend && sudo docker compose up -d --remove-orphans |