From 2400fe2e07e72de194af9f7d9e201e7a9fa4353b Mon Sep 17 00:00:00 2001 From: manosmin Date: Mon, 11 Aug 2025 21:43:43 +0300 Subject: [PATCH 1/4] 11.21 --- .github/workflows/pipeline.yml | 70 ++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/pipeline.yml diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml new file mode 100644 index 0000000..34392c1 --- /dev/null +++ b/.github/workflows/pipeline.yml @@ -0,0 +1,70 @@ +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 + + - 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 }} + - 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! + username: ${{ github.event.head_commit.author.username }} + title: ${{ github.repository }} + description: ${{ github.sha }}(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! + username: ${{ github.event.head_commit.author.username }} + title: ${{ github.repository }} + description: ${{ github.sha }}(https://github.com/${{ github.repository }}/commit/${{ github.sha }}) \ No newline at end of file From 9e98b30e4d3e2e694d9fa1814cac2acf0c897992 Mon Sep 17 00:00:00 2001 From: manosmin Date: Mon, 11 Aug 2025 21:47:23 +0300 Subject: [PATCH 2/4] 11.21 --- README.MD | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.MD diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..981eb65 --- /dev/null +++ b/README.MD @@ -0,0 +1 @@ +https://fullstackopen-part11-3cp8.onrender.com/ \ No newline at end of file From d263b48bd84ec9d075c14abb16dd0fe240fc731d Mon Sep 17 00:00:00 2001 From: manosmin Date: Mon, 11 Aug 2025 21:51:33 +0300 Subject: [PATCH 3/4] 11.21 --- .github/workflows/health-checks.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/health-checks.yml diff --git a/.github/workflows/health-checks.yml b/.github/workflows/health-checks.yml new file mode 100644 index 0000000..5e4048d --- /dev/null +++ b/.github/workflows/health-checks.yml @@ -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 \ No newline at end of file From 89ae4430ad385e9f245b16d21ba2278d06aaa5f0 Mon Sep 17 00:00:00 2001 From: manosmin Date: Tue, 12 Aug 2025 00:25:02 +0300 Subject: [PATCH 4/4] 11.21 --- .github/workflows/pipeline.yml | 45 +++++++++++++++++----------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 34392c1..8189296 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -30,7 +30,28 @@ jobs: npm run build working-directory: phonebook-frontend - - uses: sws2apps/render-deployment@v1.8.0 + - 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 }} @@ -47,24 +68,4 @@ jobs: - name: Bump version and push tag uses: anothrNick/github-tag-action@1.73.0 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - 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! - username: ${{ github.event.head_commit.author.username }} - title: ${{ github.repository }} - description: ${{ github.sha }}(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! - username: ${{ github.event.head_commit.author.username }} - title: ${{ github.repository }} - description: ${{ github.sha }}(https://github.com/${{ github.repository }}/commit/${{ github.sha }}) \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file