From 5ba239452d2a4786cde19fb15c860f1ae4a90b69 Mon Sep 17 00:00:00 2001 From: lifehackerhansol Date: Tue, 23 Apr 2024 23:44:44 -0700 Subject: [PATCH] Add GitHub Actions workflow --- .github/workflows/publish.yml | 49 +++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 23 ++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..b05ec66 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,49 @@ +name: Deploy site + +on: + push: + branches: [ master ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + submodules: recursive + + - name: Configure GitHub Pages + uses: actions/configure-pages@v3 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + bundler-cache: true + + - name: Run Jekyll + # Build the site using Jekyll + run: JEKYLL_ENV=production bundle exec jekyll build + + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v3 + + # Deployment job + deploy: + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages + permissions: + contents: read + pages: write + id-token: write + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5e360df --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: Test site build + +on: + pull_request: + +jobs: + doc-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + submodules: recursive + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + bundler-cache: true + + - name: Run Jekyll + # Build the site using Jekyll + run: JEKYLL_ENV=production bundle exec jekyll build