Skip to content

Commit

Permalink
Refactor GitHub Pages deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
fire committed Oct 29, 2023
1 parent 896ffa5 commit 35f3543
Showing 1 changed file with 49 additions and 30 deletions.
79 changes: 49 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,60 @@
name: Build and Deploy

on:
# Runs on pushes targeting the default branch
push:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

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

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

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

steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Setup Pandoc
run: |
sudo apt-get install pandoc
- name: Convert README to HTML
run: |
pandoc -s README.md -o index.html
- name: Create build directory if not exists
run: |
mkdir -p build
- name: Move index.html to build
run: |
mv index.html build/
- name: Copy store to build
run: |
cp -r store/ build/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: build
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Setup Pandoc
run: |
sudo apt-get install pandoc
- name: Convert README to HTML
run: |
pandoc -s README.md -o index.html
- name: Create build directory if not exists
run: |
mkdir -p build
- name: Move index.html to build
run: |
mv index.html build/
- name: Copy store to build
run: |
cp -r store/ build/
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: build

0 comments on commit 35f3543

Please sign in to comment.