Skip to content

Commit

Permalink
ci: set github actions for deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi committed Oct 17, 2023
1 parent 3c9d53d commit ffc639b
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build and Deploy

on:
push:
branches:
- main
paths:
- "docs/**"
- _quarto.yml
- docusaurus.config.js
- sidebars.js
pull_request:
paths:
- .github/workflows/main.yml
- "docs/**"
- _quarto.yml
- docusaurus.config.js
- sidebars.js
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Install devcontainer CLI
run: npm install -g @devcontainers/cli

- name: Start dev container
run: devcontainer up --workspace-folder .

- name: Start dev container
run: devcontainer up --workspace-folder .

- name: Quarto render
run: devcontainer exec --workspace-folder . quarto render

- name: Docusaurus build
run: npm run build

- name: Upload artifact
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: build
path: build

- name: Deploy to GitHub Pages
if: ${{ github.ref == 'refs/heads/main'}}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
cname: rocker-project.org

0 comments on commit ffc639b

Please sign in to comment.