Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
Add pages build
Browse files Browse the repository at this point in the history
  • Loading branch information
Paillat-dev committed Aug 1, 2024
1 parent 10a2ad9 commit 1ffccd4
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ jobs:
unit-tests:
uses: ./.github/workflows/unit-tests.yml

pages:
uses: ./.github/workflows/pages.yml
needs: [unit-tests, validation]
permissions:
contents: write
pull-requests: write

docker:
uses: ./.github/workflows/docker.yml
needs: [unit-tests, validation]
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: marp-to-pages
concurrency: marp-to-pages

on:
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:

- name: Checkout code
uses: actions/checkout@v3

- name: Ensure build dir exists
run: mkdir -p build

- name: Copy images directory (if exists)
run: if [[ -d presentation/img ]]; then cp -R presentation/img build/img; fi

- name: Marp Build (README)
uses: docker://marpteam/marp-cli:v3.0.2
with:
args: README.md -o build/index.html
env:
MARP_USER: root:root

- name: Deploy preview
if: ${{ github.event_name == 'pull_request' }}
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./build/
preview-branch: gh-pages
umbrella-dir: pr-preview

- name: Deploy production
if: ${{ github.event_name == 'push' }}
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: ./build/
clean-exclude: pr-preview/

0 comments on commit 1ffccd4

Please sign in to comment.