name: build + push containers to gitea (every) and docker (daily) on: push: branches: [ "master" ] schedule: - cron: '0 0 * * 0' # weekly check workflow_dispatch: jobs: dockerhub: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Get current version id: current run: | CURRENT=$(cat version.txt || echo "none") echo "version=$CURRENT" >> $GITHUB_OUTPUT - name: check latest yt-dlp release id: latest run: | LATEST=$(curl -s https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest | jq -r .tag_name || echo "error") if [ "$LATEST" == "error" ]; then echo "failed to fetch latest version" >&2 exit 1 fi echo "yt-dlp version=$LATEST" >> $GITHUB_OUTPUT - name: Update version file if changed run: echo ${{ steps.latest.outputs.version }} > version.txt if: ${{ steps.current.outputs.version != steps.latest.outputs.version }} - name: Login to Dockerhub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push to Dockerhub uses: docker/build-push-action@v5 with: push: true tags: | eulaly/youdis:latest eulaly/youdis:${{ steps.latest.outputs.version }} if: ${{ steps.current.outputs.version != steps.latest.outputs.version }} gitea: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Login to Gitea (local) uses: docker/login-action@v2 with: registry: git.hgsky.me username: ${{ secrets.GITEA_USERNAME }} password: ${{ secrets.GITEA_TOKEN }} - name: Build and push to Gitea (all pushes) uses: docker/build-push-action@v5 with: push: true tags: | git.hgsky.me/eulaly/youdis:latest git.hgsky.me/eulaly/youdis:dev-${{ github.sha }}