-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.36 KB
/
part3-express-app.yml
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
name: Release Node.js app
on:
push:
branches:
- main
# Added specifically to avoid creating other repo and running actions from this directory only for express-app
paths:
- "part3/express-app/**"
- ".github/workflows/part3-express-app.yml"
jobs:
publish-docker-hub:
name: Publish image to Docker Hub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: part3/express-app
file: part3/express-app/Dockerfile
push: true
tags: mmiglioranza22/express-app:latest
deploy-to-render:
name: Deploy image to Render
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Render Deployment
uses: sws2apps/[email protected]
# condition to test it works, commit message #skip does not trigger deploy
if: ${{ github.event_name == 'push' && !contains(toJson(github.event.commits.*.message), '#skip')}}
with:
serviceId: ${{ secrets.RENDER_SERVICE_ID }}
apiKey: ${{ secrets.RENDER_API_KEY }}
multipleDeployment: false