Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/health-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Health checks

on:
schedule:
- cron: "0 * * * *"

jobs:
health-checks:
runs-on: ubuntu-latest
steps:
- name: Check the deployed service URL
uses: jtalk/url-health-check-action@v4
with:
# Check the following URLs one by one sequentially
url: https://fullstackopen-part11-3cp8.onrender.com
# Follow redirects, or just report success on 3xx status codes
follow-redirect: false # Optional, defaults to "false"
# Fail this action after this many failed attempts
max-attempts: 3 # Optional, defaults to 1
# Delay between retries
retry-delay: 5s # Optional, only applicable to max-attempts > 1
# Retry all errors, including 404. This option might trigger curl upgrade.
retry-all: false # Optional, defaults to "false"
# String representation of cookie attached to health check request.
# Format: `Name=Value`
# cookie: "token=asdf1234" # Optional, default is empty
# Basic auth login password pair.
# Format: `login:password`
# basic-auth: "login:password" # Optional, default is empty
71 changes: 71 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Deployment pipeline

on:
push:
branches:
- main
pull_request:
branches: [main]
types: [opened, synchronize]

jobs:
simple_deployment_pipeline:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install and lint backend
run: |
npm install
npm run lint
working-directory: phonebook-backend

- name: Install, lint and build frontend
run: |
npm install
npm run lint
npm run build
working-directory: phonebook-frontend

- name: Notify success
uses: rjstone/discord-webhook-notify@v2
if: success()
with:
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
severity: info
details: A new version has been released
title: ${{ github.repository }}
description: ${{ github.event.head_commit.author.username }} - https://github.com/${{ github.repository }}/commit/${{ github.sha }}

- name: Notify failure
uses: rjstone/discord-webhook-notify@v2
if: failure()
with:
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
severity: error
details: Build failed
title: ${{ github.repository }}
description: ${{ github.event.head_commit.author.username }} - https://github.com/${{ github.repository }}/commit/${{ github.sha }}

- name: Deploy app
uses: sws2apps/render-deployment@v1.8.0
if: github.event_name == 'push' && !contains(github.event.head_commit.message, '#skip')
with:
serviceId: ${{ secrets.RENDER_SERVICE_ID }}
apiKey: ${{ secrets.RENDER_API_KEY }}
multipleDeployment: false

tag_release:
needs: [simple_deployment_pipeline]
runs-on: ubuntu-latest
if: |
github.event_name == 'push' && !contains(github.event.head_commit.message, '#skip')
steps:
- uses: actions/checkout@v4
- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.73.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://fullstackopen-part11-3cp8.onrender.com/