forked from obhq/obhq.github.io
-
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.
Added .yml files and changed folder structure
I hate github actions...
- Loading branch information
Showing
25 changed files
with
804 additions
and
843 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,113 @@ | ||
# Automatically update the database when an issue in the compatibility repo gets updated | ||
|
||
name: Compatibility List Updater | ||
on: | ||
issues: | ||
types: | ||
- opened | ||
- labeled | ||
- edited | ||
- closed | ||
- deleted | ||
repositories: | ||
- obhq/compatibility | ||
workflow_dispatch: | ||
inputs: | ||
manual: | ||
description: Manually updates the database! | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
HOMEBREW_API_TOKEN: ${{ secrets.HOMEBREW_API_TOKEN }} | ||
TMDB_HEX: ${{ secrets.TMDB_HEX }} | ||
|
||
defaults: | ||
run: | ||
working-directory: updater/ | ||
|
||
jobs: | ||
build: | ||
name: obhqWebsite_database_updater | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: setup rust | ||
run: | | ||
rustup update stable | ||
rustup default stable | ||
- name: restore old images && database | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git fetch origin gh-pages | ||
git switch gh-pages --force | ||
mkdir -p /home/runner/work/obhqWebsite/temp/updater/images/ | ||
# if there are images, copy em over | ||
if [ -d /home/runner/work/obhqWebsite/obhqWebsite/compatibility/_images/ ]; then | ||
echo "Copying Images" | ||
cp -a -r -f /home/runner/work/obhqWebsite/obhqWebsite/compatibility/_images/* /home/runner/work/obhqWebsite/temp/updater/images/ | ||
fi | ||
# if there is an old main db, copy it over | ||
if [ -f /home/runner/work/obhqWebsite/obhqWebsite/compatibility/database.json ]; then | ||
echo "Copying Old Database" | ||
cp -a -r -f /home/runner/work/obhqWebsite/obhqWebsite/compatibility/database.json /home/runner/work/obhqWebsite/temp/updater/database.json | ||
fi | ||
git fetch origin main | ||
git switch main --force | ||
- name: run obhqWebsite_database_updater | ||
run: cargo run --release | ||
|
||
- name: Commit and push changes to main | ||
run: | | ||
git fetch origin main | ||
git add game_skips.json -f | ||
git add HBstore.db -f | ||
git add config/config.toml -f | ||
files_to_commit=$(git status --porcelain | grep -E 'M|A|D' | wc -l) | ||
if [ $files_to_commit -gt 0 ]; then | ||
echo "Committing changes!" | ||
git fetch origin main | ||
git commit -m "Automatic Compatibility List Update" | ||
git push origin main | ||
else | ||
echo "No changes to commit." | ||
fi | ||
- name: Commit and push changes to gh-pages | ||
run: | | ||
git fetch origin gh-pages | ||
git switch gh-pages --force | ||
mkdir -p /home/runner/work/obhqWebsite/obhqWebsite/compatibility/_images/ | ||
rm -r -f /home/runner/work/obhqWebsite/obhqWebsite/compatibility/_images/games/ | ||
rm -r -f /home/runner/work/obhqWebsite/obhqWebsite/compatibility/_images/hb/ | ||
rm -f /home/runner/work/obhqWebsite/obhqWebsite/compatibility/database.json | ||
rm -f /home/runner/work/obhqWebsite/obhqWebsite/stats.json | ||
mv -f /home/runner/work/obhqWebsite/temp/updater/images/* /home/runner/work/obhqWebsite/obhqWebsite/compatibility/_images/ | ||
mv -f /home/runner/work/obhqWebsite/temp/updater/database.json /home/runner/work/obhqWebsite/obhqWebsite/compatibility/database.json | ||
mv -f /home/runner/work/obhqWebsite/temp/updater/stats.json /home/runner/work/obhqWebsite/obhqWebsite/stats.json | ||
git add /home/runner/work/obhqWebsite/obhqWebsite/stats.json -f | ||
git add /home/runner/work/obhqWebsite/obhqWebsite/compatibility/database.json -f | ||
git add /home/runner/work/obhqWebsite/obhqWebsite/compatibility/_images/ -f | ||
files_to_commit=$(git status --porcelain | grep -E 'M|A|D' | wc -l) | ||
if [ $files_to_commit -gt 0 ]; then | ||
echo "Committing changes!" | ||
git fetch origin gh-pages | ||
git commit -m "Automatic Compatibility List Update" | ||
git push origin gh-pages | ||
else | ||
echo "No changes to commit." | ||
fi |
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,57 @@ | ||
# Automatically updates the mdbook on build | ||
|
||
name: mdbook updater | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- mdbook/** | ||
workflow_dispatch: | ||
inputs: | ||
manual: | ||
description: Manually updates the mdbook! | ||
|
||
defaults: | ||
run: | ||
working-directory: mdbook/ | ||
|
||
jobs: | ||
build: | ||
name: mdbook updater | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: setup rust | ||
run: | | ||
rustup update stable | ||
rustup default stable | ||
- name: install mdbook | ||
run: cargo install mdbook | ||
|
||
- name: build mdbook | ||
run: | | ||
mdbook build --dest-dir /home/runner/work/obhqWebsite/temp/wiki/ | ||
- name: Commit and push changes to gh-pages | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git fetch origin gh-pages | ||
git switch gh-pages --force | ||
rm -r -f /home/runner/work/obhqWebsite/obhqWebsite/wiki/ | ||
mv -f /home/runner/work/obhqWebsite/temp/wiki/ /home/runner/work/obhqWebsite/obhqWebsite/wiki/ | ||
git add /home/runner/work/obhqWebsite/obhqWebsite/wiki/ | ||
files_to_commit=$(git status --porcelain | grep -E 'M|A|D' | wc -l) | ||
if [ $files_to_commit -gt 0 ]; then | ||
echo "Committing changes!" | ||
git fetch origin gh-pages | ||
git commit -m "Automatic mdbook Update" | ||
git push origin gh-pages | ||
else | ||
echo "No changes to commit." | ||
fi |
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,55 @@ | ||
name: public_html update | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- public_html/** | ||
workflow_dispatch: | ||
inputs: | ||
manual: | ||
description: Manually updates the public_html! | ||
|
||
jobs: | ||
build: | ||
name: public_html Updater | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Copy files | ||
run: | | ||
mkdir -p /home/runner/work/obhqWebsite/temp/public_html/ | ||
cp -a -r -f /home/runner/work/obhqWebsite/obhqWebsite/public_html/* /home/runner/work/obhqWebsite/temp/public_html/ | ||
- name: Commit and push changes to gh-pages | ||
run: | | ||
# Switch to gh-pages | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git fetch origin gh-pages | ||
git switch gh-pages --force | ||
# put the new files into the folder | ||
rm -r -f /home/runner/work/obhqWebsite/obhqWebsite/* | ||
mv -f /home/runner/work/obhqWebsite/temp/public_html/* /home/runner/work/obhqWebsite/obhqWebsite/ | ||
touch /home/runner/work/obhqWebsite/obhqWebsite/.nojekyll | ||
git add /home/runner/work/obhqWebsite/obhqWebsite/ -f | ||
# restore files that dont need updating | ||
git restore --staged --worktree wiki/ | ||
git restore --staged --worktree compatibility/_images/games/ | ||
git restore --staged --worktree compatibility/_images/hb/ | ||
git restore --staged --worktree compatibility/database.json | ||
git restore --staged --worktree stats.json | ||
files_to_commit=$(git status --porcelain | grep -E 'M|A|D' | wc -l) | ||
if [ $files_to_commit -gt 0 ]; then | ||
echo "Committing changes!" | ||
git fetch origin gh-pages | ||
git commit -m "Automatic public_html update" | ||
git push origin gh-pages | ||
else | ||
echo "No changes to commit." | ||
fi |
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
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
This file was deleted.
Oops, something went wrong.
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
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 @@ | ||
Prevents Github Pages from being silly |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.