Files
Main/.gitea/workflows/ci.yml
T
connor 41e809c9dc
CI / check (push) Failing after 54s
CI / docker (push) Skipped
Add deno and weekly yt-dlp refresh to the image
Install deno in the runtime stage and yt-dlp[default] (which brings
yt-dlp-ejs) so YouTube JS challenges can be solved. Replace the
--upgrade layer with a YTDLP_REFRESH build arg, and add a weekly
scheduled CI build that passes the date and --pull.
2026-10-26 11:12:31 -04:00

63 lines
2.1 KiB
YAML

name: CI
on:
push:
pull_request:
schedule:
# Weekly image refresh for yt-dlp and the base images. Gitea reads cron in
# UTC: Saturday 23:00 EDT / 22:00 EST on mainframe, ahead of
# podman-stack-update.timer pulling :latest at Sunday 04:00 local.
- cron: '0 3 * * 0'
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITEA }}
- name: Configure git to use HTTPS for submodules
run: |
git config --global url."https://${{ secrets.GITEA }}@git.rcjohnstone.com/".insteadOf "ssh://connor@git.rcjohnstone.com:2222/"
git submodule update --init --recursive
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- run: cargo fmt --check
- run: cargo clippy --workspace -- -D warnings
- run: cargo build --workspace
- run: cargo test --workspace
docker:
runs-on: ubuntu-latest
needs: check
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'schedule')
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITEA }}
- name: Configure git to use HTTPS for submodules
run: |
git config --global url."https://${{ secrets.GITEA }}@git.rcjohnstone.com/".insteadOf "ssh://connor@git.rcjohnstone.com:2222/"
git submodule update --init --recursive
- name: Log in to container registry
run: echo "${{ secrets.GITEA }}" | docker login git.rcjohnstone.com -u connor --password-stdin
- name: Build and push
run: |
extra_args=""
if [ "${{ github.event_name }}" = "schedule" ]; then
extra_args="--pull --build-arg YTDLP_REFRESH=$(date -u +%Y-%m-%d)"
fi
docker build $extra_args -t git.rcjohnstone.com/connor/shanty:latest -t git.rcjohnstone.com/connor/shanty:${{ github.sha }} .
docker push git.rcjohnstone.com/connor/shanty:latest
docker push git.rcjohnstone.com/connor/shanty:${{ github.sha }}