Skip to content

Commit bc0e519

Browse files
committed
added deploy scripts
1 parent add01ed commit bc0e519

File tree

3 files changed

+46
-2
lines changed

3 files changed

+46
-2
lines changed

.github/workflows/deploy.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Deploy to VPS"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Check out the repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Docker Buildx
17+
uses: docker/setup-buildx-action@v3
18+
19+
- name: DockerHub login
20+
uses: docker/login-action@v3
21+
with:
22+
username: ${{ secrets.DOCKERHUB_USERNAME }}
23+
password: ${{ secrets.DOCKERHUB_TOKEN }}
24+
25+
- name: Build and push to DockerHub
26+
run: |
27+
docker build -t devarifhossain/retroui:1.02 ./
28+
docker push devarifhossain/retroui-web:1.02
29+
30+
- name: Set up SSH
31+
uses: webfactory/ssh-agent@v0.9.0
32+
with:
33+
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
34+
35+
- name: Add VPS to known_hosts
36+
run: |
37+
ssh-keyscan -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts
38+
39+
- name: Deploy to VPS
40+
run: |
41+
ssh ${{ secrets.VPS_USERNAME }}@${{ secrets.VPS_HOST }} "cd /root/retroui && git pull && docker compose -f ./infra/docker-compose.prod.yml up -d"

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
"tailwindCSS.experimental.classRegex": [
77
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
88
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
9-
]
9+
],
10+
"yaml.schemas": {
11+
"https://json.schemastore.org/github-workflow.json": "file:///Users/arifhossain/Projects/ptm/retro-ui/.github/workflows/deploy.yml"
12+
}
1013
}

infra/Caddyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
retroui.dev {
1+
new.retroui.dev {
22
reverse_proxy retroui:3000
33
}

0 commit comments

Comments
 (0)