-
Notifications
You must be signed in to change notification settings - Fork 897
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into nomadscientist-patch-1
- Loading branch information
Showing
48 changed files
with
6,807 additions
and
128 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
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 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,74 @@ | ||
name: "[Social] Autogenerate missing social media cards" | ||
|
||
on: | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
# We'll run this daily at noon. | ||
- cron: '0 12 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
all_old: | ||
type: string | ||
description: If you want to re-generate ALL images set to a non-empty value | ||
|
||
jobs: | ||
runner-job: | ||
if: github.repository_owner == 'galaxyproject' | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Shallow should be fine for video | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 500 | ||
|
||
# BEGIN Dependencies | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
architecture: 'x64' | ||
- name: Install dependencies | ||
run: | | ||
sudo apt-get install -y imagemagick | ||
mkdir -p ~/.fonts/ | ||
wget https://galaxy-training.s3.amazonaws.com/social/recursive.ttf -O ~/.fonts/recursive.ttf | ||
fc-cache -rv | ||
# END Dependencies | ||
|
||
|
||
# We get the previous build ID to know how many videos were changed since | ||
# then. | ||
# | ||
# We *could* fetch the diff in the past N days but if a build fails for | ||
# any reason, we'd lose those changes permanently and things would never | ||
# get built. | ||
# | ||
# So instead we just track the last successfully built timestamp | ||
- name: Previous build ID | ||
id: build_id | ||
run: | | ||
echo "timestamp=$(curl https://galaxy-training.s3.amazonaws.com/social/timestamp.txt -f 2>/dev/null || echo none)" >> $GITHUB_ENV | ||
# Support regenerating all | ||
if [[ "${{ github.event.inputs.selected_tag }}" != "" ]]; then | ||
echo "timestamp=0" >> $GITHUB_ENV | ||
fi | ||
# The actual compilation process deposits everything in the ./social/ folder. | ||
# And requires fetching metadata from the live website (api/social-meta.json) | ||
- name: Build Social Media Cards | ||
run: | | ||
mkdir -p social/ | ||
python bin/social-cards.py $PREVIOUS_TIMESTAMP | ||
env: | ||
PREVIOUS_TIMESTAMP: ${{ env.timestamp }} | ||
|
||
# Deploy step, scary. | ||
- uses: jakejarvis/s3-sync-action@v0.5.1 | ||
with: | ||
args: --acl public-read --follow-symlinks | ||
env: | ||
AWS_S3_BUCKET: galaxy-training | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
SOURCE_DIR: './social/' | ||
DEST_DIR: 'social/' |
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 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 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 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
Oops, something went wrong.