forked from gadingnst/quran-api
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.15 KB
/
Copy pathdocker-publish-staging.yml
File metadata and controls
48 lines (41 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Build & Deploy Staging
on:
push:
branches:
- staging
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 🧾 Checkout source
uses: actions/checkout@v4
- name: 📁 Inject .env file
run: |
echo "${{ secrets.STAGING_ENV }}" > .env
- name: 🐳 Docker Login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: 🛠️ Build & Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
NODE_ENV=staging
tags: |
calypso666/waktusolat.me:staging
- name: 🚀 Deploy via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.SSH_KEY }}
script: |
cd ~/own
docker compose down waktusolat.me || true
docker compose down waktusolat.me-staging || true
docker pull calypso666/waktusolat.me:staging
docker compose up -d waktusolat.me-staging