Skip to content

Commit

Permalink
ci: publish pages using Github Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
MikkCZ committed Apr 6, 2024
1 parent 1416d90 commit 2327697
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build

on:
push:
branches:
- master
pull_request:
workflow_dispatch: # allows to be run manually
workflow_call: # when called from another workflow

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Build site
run: |
mkdir -p _site
find . -maxdepth 1 -mindepth 1 -not -name _site -not -name '*.md' -not -name LICENSE -not -name .github -not -name .gitignore -not -name .git -exec cp -r '{}' _site \;
- name: Save built site for deploy
uses: actions/upload-pages-artifact@v3
with:
path: _site
retention-days: 7
34 changes: 34 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy to GitHub Pages

on:
push:
branches:
- master
workflow_dispatch: # allows to be run manually

# 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

jobs:
build:
uses: ./.github/workflows/build.yml
deploy:
if: github.ref == 'refs/heads/master'
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- id: deployment
name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_site
Empty file removed .nojekyll
Empty file.
1 change: 0 additions & 1 deletion CNAME

This file was deleted.

0 comments on commit 2327697

Please sign in to comment.