Skip to content

Commit

Permalink
Added CI workflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
moonstar-x committed Nov 3, 2024
1 parent db16517 commit 54ab921
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/callable-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish Site

on:
workflow_call:
inputs:
message:
type: string
required: true
secrets:
netlify_token:
required: true
netlify_site_id:
required: true

jobs:
publish:
name: Puslish Site
runs-on: ubuntu-latest

steps:
- name: Checkout the Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: pip

- name: Install Dependencies
run: pip install -r requirements.txt

- name: Build Site
run: mkdocs build --clean

- name: Deploy to Netlify
uses: jsmrcaga/action-netlify-deploy@v2.3.0
with:
NETLIFY_AUTH_TOKEN: ${{ secrets.netlify_token }}
NETLIFY_SITE_ID: ${{ secrets.netlify_site_id }}
NETLIFY_DEPLOY_TO_PROD: true
NETLIFY_DEPLOY_MESSAGE: ${{ inputs.message }}
build_directory: site
install_command: 'echo Dependencies already installed.'
build_command: 'echo Project already built.'
16 changes: 16 additions & 0 deletions .github/workflows/on-push-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: On Push (Main)

on:
push:
branches:
- main

jobs:
publish:
name: Publish Site
uses: ./.github/workflows/callable-publish.yml
with:
message: ${{ github.event.head_commit.message }}
secrets:
netlify_token: ${{ secrets.NETLIFY_TOKEN }}
netlify_site_id: ${{ secrets.NETLIFY_SITE_ID }}

0 comments on commit 54ab921

Please sign in to comment.