-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Process Markdown Files with Obs3dian | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**/*.md' | ||
|
||
jobs: | ||
install: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install AWS CLI | ||
run: | | ||
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | ||
unzip awscliv2.zip | ||
sudo ./aws/install | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install obs3dian | ||
config: | ||
runs-on: ubuntu-latest | ||
needs: install | ||
steps: | ||
- name: Configure AWS CLI | ||
run: | | ||
mkdir -p ~/.aws | ||
echo "[obs3dian]" > ~/.aws/credentials | ||
echo "aws_access_key_id = ${{ secrets.AWS_ACCESS_KEY_ID }}" >> ~/.aws/credentials | ||
echo "aws_secret_access_key = ${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> ~/.aws/credentials | ||
echo "[obs3dian]" > ~/.aws/config | ||
echo "region = ${{ secrets.AWS_DEFAULT_REGION }}" >> ~/.aws/config | ||
- name: Configure Obs3dian | ||
run: | | ||
obs3dian config <<EOF | ||
Y | ||
obs3dian | ||
csocrates_image | ||
./output | ||
./ | ||
EOF | ||
process: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Process Markdown files | ||
run: | | ||
obs3dian run . --overwrite --usekey | ||
- name: Commit changes | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git add . | ||
git commit -m "Processed Markdown files using obs3dian" || echo "No changes to commit" | ||
- name: Push changes | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} |