Skip to content

Daily update

Daily update #823

Workflow file for this run

name: Daily update
on:
schedule:
- cron: '50 23 * * *'
workflow_dispatch:
concurrency:
group: "all"
cancel-in-progress: false
jobs:
update-images:
name: Update images
runs-on: ubuntu-latest
steps:
# - name: Clone repository
# uses: actions/checkout@v3
# with:
# token: ${{ secrets.PAT }}
# ssh-key: ${{ secrets.SSH_KEY }}
- name: Fetch repository info
id: repository
run: |
echo "::set-output name=name::$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')"
echo "::set-output name=url::$(echo https://${{ secrets.PAT }}@github.com/${{ github.repository }}.git)"
- name: Partially clone repository
run: |
git clone --depth 1 --filter=blob:none --sparse ${{ steps.repository.outputs.url }}
cd ${{ steps.repository.outputs.name }}
git sparse-checkout set --no-cone "*" "!*.jpg" "!*.mp4"
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: 3.11
cache: pip
- name: Install Python's requirements
working-directory: ${{ steps.repository.outputs.name }}/src
run: pip install -r requirements.txt
- name: Google Cloud Authentication
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.GCLOUD_CREDENTIALS }}'
- name: Update archive
working-directory: ${{ steps.repository.outputs.name }}/src
run: python update.py
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
repository: ${{ steps.repository.outputs.name }}
commit_message: "Archive update"
add_options: --sparse
commit_user_name: GitHub Actions
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com
commit_author: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>