microsoft / Security-101

8 Lessons, Kick-start Your Cybersecurity Learning.
https://microsoft.github.io/Security-101/
Creative Commons Zero v1.0 Universal
4.33k stars 507 forks source link

Setup GitHub Actions for README auto-deployment to GitHub Pages #33

Closed AnthonyByansi closed 3 months ago

AnthonyByansi commented 4 months ago

Hi @fhinkel

This pull request adds a GitHub Actions workflow to automatically publish changes from the README.md to GitHub Pages. The workflow is triggered on pushes to the main branch that include changes to the README.md. It converts the README.md into an index.html and deploys it.

Changes:

Resolves #22

fhinkel commented 4 months ago

Hi @AnthonyByansi 👋 Thanks for the PR! Adding @sarah-yo for review.

sarah-yo commented 4 months ago

Hi @AnthonyByansi, what is the goal of this PR?

AnthonyByansi commented 4 months ago

Hi @sarah-yo Well, as you might have noticed, the repo site is not updated automatically, it only reflects changes for the initial deployment. image

As spotted by #22 reolves #22

sarah-yo commented 3 months ago

@AnthonyByansi understand. However, this can be done using a first party Github action now rather than a third party one (like this example here: https://github.com/tonybaloney/vscode-pets/blob/main/.github/workflows/docs.yml , please can you update this to use native GH actions?

AnthonyByansi commented 3 months ago

Hi @sarah-yo I've made modifications to the workflow through: https://github.com/microsoft/Security-101/pull/33/commits/03819b09d682637e8b3b14b5e375309e5a99876c

sarah-yo commented 3 months ago

@AnthonyByansi can you please make sure the job had appripriate permissions, I think you need a statement along the lines of this:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
  contents: read
  pages: write
  id-token: write

# Allow one concurrent deployment
concurrency:
  group: "pages"
  cancel-in-progress: true
AnthonyByansi commented 3 months ago

@sarah-yo Thanks for your constructive feedback. I've added the necessary sections through https://github.com/microsoft/Security-101/pull/33/commits/14109baada1f6d3edf8d169295420157db7c865e and https://github.com/microsoft/Security-101/pull/33/commits/8e73a8b39b2e5fdf772429743223531e80d3e0ae