Skip to content

Commit 95174b7

Browse files
authored
Merge pull request #1 from manosmin/feature_branch
Feature branch
2 parents 070ca06 + dfd8bec commit 95174b7

3 files changed

Lines changed: 101 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Health checks
2+
3+
on:
4+
schedule:
5+
- cron: "0 * * * *"
6+
7+
jobs:
8+
health-checks:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Check the deployed service URL
12+
uses: jtalk/url-health-check-action@v4
13+
with:
14+
# Check the following URLs one by one sequentially
15+
url: https://fullstackopen-part11-3cp8.onrender.com
16+
# Follow redirects, or just report success on 3xx status codes
17+
follow-redirect: false # Optional, defaults to "false"
18+
# Fail this action after this many failed attempts
19+
max-attempts: 3 # Optional, defaults to 1
20+
# Delay between retries
21+
retry-delay: 5s # Optional, only applicable to max-attempts > 1
22+
# Retry all errors, including 404. This option might trigger curl upgrade.
23+
retry-all: false # Optional, defaults to "false"
24+
# String representation of cookie attached to health check request.
25+
# Format: `Name=Value`
26+
# cookie: "token=asdf1234" # Optional, default is empty
27+
# Basic auth login password pair.
28+
# Format: `login:password`
29+
# basic-auth: "login:password" # Optional, default is empty

.github/workflows/pipeline.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Deployment pipeline
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches: [main]
9+
types: [opened, synchronize]
10+
11+
jobs:
12+
simple_deployment_pipeline:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
20+
- name: Install and lint backend
21+
run: |
22+
npm install
23+
npm run lint
24+
working-directory: phonebook-backend
25+
26+
- name: Install, lint and build frontend
27+
run: |
28+
npm install
29+
npm run lint
30+
npm run build
31+
working-directory: phonebook-frontend
32+
33+
- name: Notify success
34+
uses: rjstone/discord-webhook-notify@v2
35+
if: success()
36+
with:
37+
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
38+
severity: info
39+
details: A new version has been released
40+
title: ${{ github.repository }}
41+
description: ${{ github.event.head_commit.author.username }} - https://github.com/${{ github.repository }}/commit/${{ github.sha }}
42+
43+
- name: Notify failure
44+
uses: rjstone/discord-webhook-notify@v2
45+
if: failure()
46+
with:
47+
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
48+
severity: error
49+
details: Build failed
50+
title: ${{ github.repository }}
51+
description: ${{ github.event.head_commit.author.username }} - https://github.com/${{ github.repository }}/commit/${{ github.sha }}
52+
53+
- name: Deploy app
54+
uses: sws2apps/render-deployment@v1.8.0
55+
if: github.event_name == 'push' && !contains(github.event.head_commit.message, '#skip')
56+
with:
57+
serviceId: ${{ secrets.RENDER_SERVICE_ID }}
58+
apiKey: ${{ secrets.RENDER_API_KEY }}
59+
multipleDeployment: false
60+
61+
tag_release:
62+
needs: [simple_deployment_pipeline]
63+
runs-on: ubuntu-latest
64+
if: |
65+
github.event_name == 'push' && !contains(github.event.head_commit.message, '#skip')
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Bump version and push tag
69+
uses: anothrNick/github-tag-action@1.73.0
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.MD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://fullstackopen-part11-3cp8.onrender.com/

0 commit comments

Comments
 (0)