Skip to content

build: Add GitHub Action config for CI/CD #1

build: Add GitHub Action config for CI/CD

build: Add GitHub Action config for CI/CD #1

Workflow file for this run

name: Build and Deploy to Production
on:
push:
branches: [master]
jobs:
deploy:
if: "contains(github.event.head_commit.message, 'DEPLOY')"
name: πŸŽ‰ Build and Deploy App
runs-on: ubuntu-latest
steps:
- name: πŸ“¦ Get latest code
uses: actions/checkout@v3
- name: 🚚 Send files via SCP
uses: appleboy/scp-action@v0.1.4
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
source: "./*"
target: /root/apps/kampung_budaya_2023
- name: πŸ‹ Rebuild docker image and rerun
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
port: ${{ secrets.PORT }}
script: cd /root/apps/kampung_budaya_2023 && docker compose up -d --no-deps --build backend