-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add new secrets to GitHub Action
- Loading branch information
Showing
3 changed files
with
9 additions
and
37 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Deploy Quartz site to GitHub Pages | ||
name: Deploy site to GitHub Pages | ||
|
||
on: | ||
push: | ||
|
@@ -17,46 +17,18 @@ concurrency: | |
cancel-in-progress: false | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Update submodules | ||
run: | | ||
previous_status=$(git status) | ||
git submodule update --remote --merge | ||
git submodule foreach git pull origin master --recurse-submodules | ||
current_status=$(git status) | ||
if [ "$previous_status" != "$current_status" ]; then | ||
echo "has_changed=true" >> $GITHUB_ENV | ||
else | ||
echo "has_changed=false" >> $GITHUB_ENV | ||
fi | ||
- name: Commit changes | ||
if: ${{ env.has_changed == 'true'}} | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git diff-index --quiet HEAD || git commit -m "Sync notes [skip actions]" --author "GitHub Action <[email protected]>" | ||
- name: Push changes | ||
if: ${{ env.has_changed == 'true'}} | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build: | ||
needs: sync | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: webfactory/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
token: ${{ secrets.MY_ZETTELKASTEN_ASSETS }} | ||
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
- shell: bash | ||
env: | ||
MY_ZETTELKASTEN_URL: ${{ secrets.MY_ZETTELKASTEN_URL }} | ||
run: | | ||
git clone "$MY_ZETTELKASTEN_URL" content | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.14 | ||
|
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
File renamed without changes