Skip to content

Commit

Permalink
Merge pull request #33 from AnthonyByansi/feature/auto-deploy-readme
Browse files Browse the repository at this point in the history
Setup GitHub Actions for README auto-deployment to GitHub Pages
  • Loading branch information
sarah-yo committed Jul 22, 2024
2 parents d320323 + 8e73a8b commit 84d5b03
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- main
paths:
- README.md

jobs:
build-and-deploy:
runs-on: ubuntu-latest

permissions:
contents: read

concurrency:
group: "pages"
cancel-in-progress: true

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Convert README to HTML
run: |
echo '<!DOCTYPE html><html><head><meta charset="utf-8"><title>README</title></head><body>' > index.html
cat README.md | markdown >> index.html
echo '</body></html>' >> index.html
- name: Setup Pages
uses: actions/configure-pages@v5

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: index.html

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build-and-deploy

permissions:
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 84d5b03

Please sign in to comment.