Skip to content

Commit eeb246f

Browse files
committed
add actions
1 parent 7296905 commit eeb246f

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy to Docker Hub and Render
2+
3+
on:
4+
push:
5+
branches:
6+
- retina # Change to your deployment branch
7+
8+
jobs:
9+
build-and-push:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v2
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
22+
- name: Log in to Docker Hub
23+
uses: docker/login-action@v2
24+
with:
25+
username: ${{ secrets.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
27+
28+
- name: Build and push Docker image
29+
uses: docker/build-push-action@v4
30+
with:
31+
context: .
32+
platforms: linux/amd64
33+
push: true
34+
tags: seanyl/deepgit:app
35+
36+
deploy-to-render:
37+
needs: build-and-push # Ensure this runs only after the Docker image is pushed
38+
runs-on: ubuntu-latest
39+
40+
steps:
41+
- name: Trigger Render Deployment
42+
run: |
43+
curl -X POST "$RENDER_DEPLOY_HOOK"
44+
env:
45+
RENDER_DEPLOY_HOOK: ${{ secrets.RENDER_DEPLOY_HOOK }}

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:18-alpine
2+
WORKDIR /app
3+
COPY package.json ./
4+
RUN npm install
5+
COPY . .
6+
CMD ["npm", "start"]
7+
EXPOSE 3000

0 commit comments

Comments
 (0)