Skip to content

Commit

Permalink
added deploy scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ariflogs committed Oct 9, 2024
1 parent add01ed commit bc0e519
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 2 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "Deploy to VPS"

on:
push:
branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: DockerHub login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push to DockerHub
run: |
docker build -t devarifhossain/retroui:1.02 ./
docker push devarifhossain/retroui-web:1.02
- name: Set up SSH
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Add VPS to known_hosts
run: |
ssh-keyscan -H ${{ secrets.VPS_HOST }} >> ~/.ssh/known_hosts
- name: Deploy to VPS
run: |
ssh ${{ secrets.VPS_USERNAME }}@${{ secrets.VPS_HOST }} "cd /root/retroui && git pull && docker compose -f ./infra/docker-compose.prod.yml up -d"
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
]
],
"yaml.schemas": {
"https://json.schemastore.org/github-workflow.json": "file:///Users/arifhossain/Projects/ptm/retro-ui/.github/workflows/deploy.yml"
}
}
2 changes: 1 addition & 1 deletion infra/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
retroui.dev {
new.retroui.dev {
reverse_proxy retroui:3000
}

0 comments on commit bc0e519

Please sign in to comment.