Skip to content

Check for updates and download files. #69

Check for updates and download files.

Check for updates and download files. #69

Workflow file for this run

name: Check for updates and download files.
on:
# Possibility to run it manually
workflow_dispatch:
push:
paths:
- .github/workflows/autoupdate.yaml
- .automation/*
# Automated
schedule:
# Run Every day
- cron: "0 0 * * *"
jobs:
check-for-updates:
runs-on: ubuntu-latest
outputs:
vibrant: ${{ steps.check.outputs.vibrant-out-of-date }}
photoswipe0: ${{ steps.check.outputs.photoswipe0-out-of-date }}
photoswipe1: ${{ steps.check.outputs.photoswipe1-out-of-date }}
photoswipe2: ${{ steps.check.outputs.photoswipe2-out-of-date }}
photoswipe3: ${{ steps.check.outputs.photoswipe3-out-of-date }}
katex0: ${{ steps.check.outputs.katex0-out-of-date }}
katex1: ${{ steps.check.outputs.katex1-out-of-date }}
katex2: ${{ steps.check.outputs.katex2-out-of-date }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
# setup python
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -U pip wheel
python -m pip install shyaml
- name: download latest external.yaml file and compare hashes
id: check
run: |
wget https://raw.githubusercontent.com/CaiJimmy/hugo-theme-stack/master/data/external.yaml
bash .automation/hash-check.sh external.yaml data/external.yaml Vibrant 0 integrity integrity vibrant-out-of-date
bash .automation/hash-check.sh external.yaml data/external.yaml PhotoSwipe 0 integrity integrity photoswipe0-out-of-date
bash .automation/hash-check.sh external.yaml data/external.yaml PhotoSwipe 1 integrity integrity photoswipe1-out-of-date
bash .automation/hash-check.sh external.yaml data/external.yaml PhotoSwipe 2 src original-src photoswipe2-out-of-date
bash .automation/hash-check.sh external.yaml data/external.yaml PhotoSwipe 3 src original-src photoswipe3-out-of-date
bash .automation/hash-check.sh external.yaml data/external.yaml KaTeX 0 integrity integrity katex0-out-of-date
bash .automation/hash-check.sh external.yaml data/external.yaml KaTeX 1 integrity integrity katex1-out-of-date
bash .automation/hash-check.sh external.yaml data/external.yaml KaTeX 2 integrity integrity katex2-out-of-date
- name: Cache pip files
uses: actions/cache@v3.0.4
env:
cache-name: pip-reg
with:
path: $HOME/.cache/pip
key: pip-reg
update-vibrant:
needs: check-for-updates
if: ${{ needs.check-for-updates.outputs.vibrant == 'true' }}
runs-on: ubuntu-latest
env:
FILE: static/js/vibrant.in.js
FILE_NAME: Vibrant
ROW: 0
URL_ONLY: false
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# setup python
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install shyaml
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -U pip wheel
python -m pip install shyaml
- name: Update File
run: |
wget https://raw.githubusercontent.com/CaiJimmy/hugo-theme-stack/master/data/external.yaml
wget $(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src) -O ${{ env.FILE }}
- name: Update file hash
if: ${{ env.URL_ONLY == 'false' }}
run: sed -i "s@$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.integrity)@$(echo sha256-$(openssl dgst -sha256 -binary ${{ env.FILE }} | openssl base64 -A))@g" ./data/external.yaml
- name: Update file original-src
if: ${{ env.URL_ONLY == 'true' }}
run: sed -i "s!$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.original-src)!$(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src)!g" ./data/external.yaml
- name: Commit
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
git add ${{ env.FILE }}
git add
git data/external.yaml commit -m "update ${{ env.FILE }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
update-photoswipe0:
needs: check-for-updates
if: ${{ needs.check-for-updates.outputs.photoswipe0 == 'true' }}
runs-on: ubuntu-latest
env:
FILE: static/js/photoswipe.min.js
FILE_NAME: PhotoSwipe
ROW: 0
URL_ONLY: false
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# setup python
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install shyaml
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -U pip wheel
python -m pip install shyaml
- name: Update File
run: |
wget https://raw.githubusercontent.com/CaiJimmy/hugo-theme-stack/master/data/external.yaml
wget $(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src) -O ${{ env.FILE }}
- name: Update file hash
if: ${{ env.URL_ONLY == 'false' }}
run: sed -i "s@$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.integrity)@$(echo sha256-$(openssl dgst -sha256 -binary ${{ env.FILE }} | openssl base64 -A))@g" ./data/external.yaml
- name: Update file original-src
if: ${{ env.URL_ONLY == 'true' }}
run: sed -i "s!$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.original-src)!$(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src)!g" ./data/external.yaml
- name: Commit
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
git add ${{ env.FILE }}
git add
git data/external.yaml commit -m "update ${{ env.FILE }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
update-photoswipe1:
needs: check-for-updates
if: ${{ needs.check-for-updates.outputs.photoswipe1 == 'true' }}
runs-on: ubuntu-latest
env:
FILE: static/js/photoswipe-ui-default.min.js
FILE_NAME: PhotoSwipe
ROW: 1
URL_ONLY: false
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# setup python
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install shyaml
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -U pip wheel
python -m pip install shyaml
- name: Update File
run: |
wget https://raw.githubusercontent.com/CaiJimmy/hugo-theme-stack/master/data/external.yaml
wget $(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src) -O ${{ env.FILE }}
- name: Update file hash
if: ${{ env.URL_ONLY == 'false' }}
run: sed -i "s@$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.integrity)@$(echo sha256-$(openssl dgst -sha256 -binary ${{ env.FILE }} | openssl base64 -A))@g" ./data/external.yaml
- name: Update file original-src
if: ${{ env.URL_ONLY == 'true' }}
run: sed -i "s!$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.original-src)!$(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src)!g" ./data/external.yaml
- name: result
run: cat
# - na data/external.yamlme: Commit
# run: |
# git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
# git config --local user.name "github-actions[bot]"
# git pull
# git add ${{ env.FILE }}
# git add
# g data/external.yamlit commit -m "update ${{ env.FILE }}"
# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: ${{ github.ref }}
update-photoswipe2:
needs: check-for-updates
if: ${{ needs.check-for-updates.outputs.photoswipe2 == 'true' }}
runs-on: ubuntu-latest
env:
FILE: static/js/default-skin.min.css
FILE_NAME: PhotoSwipe
ROW: 2
URL_ONLY: true
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# setup python
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install shyaml
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -U pip wheel
python -m pip install shyaml
- name: Update File
run: |
wget https://raw.githubusercontent.com/CaiJimmy/hugo-theme-stack/master/data/external.yaml
wget $(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src) -O ${{ env.FILE }}
- name: Update file hash
if: ${{ env.URL_ONLY == 'false' }}
run: sed -i "s@$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.integrity)@$(echo sha256-$(openssl dgst -sha256 -binary ${{ env.FILE }} | openssl base64 -A))@g" ./data/external.yaml
- name: Update file original-src
if: ${{ env.URL_ONLY == 'true' }}
run: sed -i "s!$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.original-src)!$(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src)!g" ./data/external.yaml
- name: result
run: cat
# - na data/external.yamlme: Commit
# run: |
# git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
# git config --local user.name "github-actions[bot]"
# git pull
# git add ${{ env.FILE }}
# git add
# g data/external.yamlit commit -m "update ${{ env.FILE }}"
# - name: Push changes
# uses: ad-m/github-push-action@master
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# branch: ${{ github.ref }}
update-photoswipe3:
needs: check-for-updates
if: ${{ needs.check-for-updates.outputs.photoswipe3 == 'true' }}
runs-on: ubuntu-latest
env:
FILE: static/js/photoswipe.min.css
FILE_NAME: PhotoSwipe
ROW: 3
URL_ONLY: true
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# setup python
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install shyaml
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -U pip wheel
python -m pip install shyaml
- name: Update File
run: |
wget https://raw.githubusercontent.com/CaiJimmy/hugo-theme-stack/master/data/external.yaml
wget $(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src) -O ${{ env.FILE }}
- name: Update file hash
if: ${{ env.URL_ONLY == 'false' }}
run: sed -i "s@$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.integrity)@$(echo sha256-$(openssl dgst -sha256 -binary ${{ env.FILE }} | openssl base64 -A))@g" ./data/external.yaml
- name: Update file original-src
if: ${{ env.URL_ONLY == 'true' }}
run: sed -i "s!$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.original-src)!$(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src)!g" ./data/external.yaml
- name: Commit
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
git add ${{ env.FILE }}
git add
git data/external.yaml commit -m "update ${{ env.FILE }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
update-katek0:
needs: check-for-updates
if: ${{ needs.check-for-updates.outputs.katex0 == 'true' }}
runs-on: ubuntu-latest
env:
FILE: static/js/katex.min.css
FILE_NAME: KaTeX
ROW: 0
URL_ONLY: false
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# setup python
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install shyaml
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -U pip wheel
python -m pip install shyaml
- name: Update File
run: |
wget https://raw.githubusercontent.com/CaiJimmy/hugo-theme-stack/master/data/external.yaml
wget $(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src) -O ${{ env.FILE }}
- name: Update file hash
if: ${{ env.URL_ONLY == 'false' }}
run: sed -i "s@$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.integrity)@$(echo sha256-$(openssl dgst -sha256 -binary ${{ env.FILE }} | openssl base64 -A))@g" ./data/external.yaml
- name: Update file original-src
if: ${{ env.URL_ONLY == 'true' }}
run: sed -i "s!$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.original-src)!$(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src)!g" ./data/external.yaml
- name: Commit
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
git add ${{ env.FILE }}
git add
git data/external.yaml commit -m "update ${{ env.FILE }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
update-katek1:
needs: check-for-updates
if: ${{ needs.check-for-updates.outputs.katex1 == 'true' }}
runs-on: ubuntu-latest
env:
FILE: static/js/katex.min.js
FILE_NAME: KaTeX
ROW: 1
URL_ONLY: false
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# setup python
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install shyaml
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -U pip wheel
python -m pip install shyaml
- name: Update File
run: |
wget https://raw.githubusercontent.com/CaiJimmy/hugo-theme-stack/master/data/external.yaml
wget $(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src) -O ${{ env.FILE }}
- name: Update file hash
if: ${{ env.URL_ONLY == 'false' }}
run: sed -i "s@$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.integrity)@$(echo sha256-$(openssl dgst -sha256 -binary ${{ env.FILE }} | openssl base64 -A))@g" ./data/external.yaml
- name: Update file original-src
if: ${{ env.URL_ONLY == 'true' }}
run: sed -i "s!$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.original-src)!$(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src)!g" ./data/external.yaml
- name: Commit
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
git add ${{ env.FILE }}
git add
git data/external.yaml commit -m "update ${{ env.FILE }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
update-katek2:
needs: check-for-updates
if: ${{ needs.check-for-updates.outputs.katex2 == 'true' }}
runs-on: ubuntu-latest
env:
FILE: static/js/auto-render.min.js
FILE_NAME: KaTeX
ROW: 2
URL_ONLY: false
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# setup python
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install shyaml
run: |
python -m pip install --upgrade pip setuptools
python -m pip install -U pip wheel
python -m pip install shyaml
- name: Update File
run: |
wget https://raw.githubusercontent.com/CaiJimmy/hugo-theme-stack/master/data/external.yaml
wget $(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src) -O ${{ env.FILE }}
- name: Update file hash
if: ${{ env.URL_ONLY == 'false' }}
run: sed -i "s@$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.integrity)@$(echo sha256-$(openssl dgst -sha256 -binary ${{ env.FILE }} | openssl base64 -A))@g" ./data/external.yaml
- name: Update file original-src
if: ${{ env.URL_ONLY == 'true' }}
run: sed -i "s!$(cat | shyaml get- data/external.yamlvalue ${{ env.FILE_NAME }}.${{ env.ROW }}.original-src)!$(cat external.yaml | shyaml get-value ${{ env.FILE_NAME }}.${{ env.ROW }}.src)!g" ./data/external.yaml
- name: Commit
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
git add ${{ env.FILE }}
git add
git data/external.yaml commit -m "update ${{ env.FILE }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}