Open-Science-Community-Saudi-Arabia / OSCSA-en-blog

OSCSA English blog
https://oscsa-en-blog.netlify.app/
2 stars 15 forks source link

[11/10/2022]: TASK 5 - Fix Deploy Preview Not Working #8

Closed okerekechinweotito closed 1 year ago

okerekechinweotito commented 1 year ago

PRs that fixed this issue available at #11 #30 and #31

Description

❔ Improve the continuous integration and deployment (CI/CD) of OSCSA Blog by fixing the deploy preview fail.

Expected behavior

✅ When a PR is made , GitHub Action should be correctly triggered ✅ GitHub should correctly Setup Quarto by running the 'Quarto Publish' Action located in the '.github/workflows' folder after a PR has been made ✅ The new changes should be seen in the deploy-preview link from Netlify

Actual behavior

❌ GitHub Action only gets triggered whenever a commit is merged to the main branch (when you merge a PR to main) ❌ GitHub Action fails to correctly initialize and build Quarto when a PR is made , this makes Netlify to serve the deploy-preview with old data from the last merged PR to main.

What needs to be done

The current code is written as

on:
  workflow_dispatch:
  push:
    branches: main

I want to Refactor the code to

on:
  workflow_dispatch:
  push:
  pull_request:
    branches: main

This is inline with this Github Netlify-Action Extension Example and Github Action Docs

Screenshot (35)

Who want to work on this issue?

@okerekechinweotito

Screenshot (34)