Skip to content

Merge pull request #38 from techbloghub/dev #10

Merge pull request #38 from techbloghub/dev

Merge pull request #38 from techbloghub/dev #10

Workflow file for this run

name: Deploy Frontend
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Docker Build and Push
uses: docker/build-push-action@v6
with:
context: .
push: true
file: ./Dockerfile
platforms: linux/amd64
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/frontend:${{ github.run_number }}
${{ secrets.DOCKER_HUB_USERNAME }}/frontend:latest
deploy:
needs: build-and-push
runs-on: ubuntu-latest
steps:
- name: Deploy to Server
uses: appleboy/[email protected]
with:
host: ${{ secrets.SERVER_IP }}
username: ubuntu
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /home/ubuntu && ./deploy-frontend.sh