docker_publish #94
This file contains hidden or 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
| name: docker_publish | |
| on: | |
| push: | |
| branches: | |
| - "master" | |
| schedule: | |
| - cron: "0 4 * * 1" # every monday at 4am UTC | |
| workflow_dispatch: | |
| # Sets the permissions granted to the GITHUB_TOKEN for the actions in this job. | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| attestations: write | |
| jobs: | |
| docker-pot: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: "true" | |
| - name: Setup docker | |
| id: setup | |
| uses: ./.github/workflows/docker-reused-setup-steps | |
| with: | |
| DOCKERHUB_ORGANIZATION_NAME : ${{ secrets.DOCKERHUB_ORGANIZATION_NAME }} | |
| DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
| DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
| tag: latest | |
| - name: Get the latest version number of yt-dlp | |
| id: get_version | |
| run: | | |
| echo "VERSION=$(curl -s https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest | jq -r '.tag_name')" >> $GITHUB_ENV | |
| - name: Build and push | |
| id: build_push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| #! Using POT image as latest for Recorder.moe yt-dlp | |
| file: ./pot.Dockerfile | |
| push: true | |
| target: final | |
| tags: ${{ steps.setup.outputs.tags }} | |
| labels: ${{ steps.setup.outputs.labels }} | |
| build-args: | | |
| VERSION=${{ env.VERSION }} | |
| RELEASE=${{ github.run_number }} | |
| platforms: linux/amd64 #,linux/arm64 | |
| sbom: true | |
| provenance: true | |
| - name: Add attestations for GitHub Container Registry | |
| uses: actions/attest-build-provenance@v2 | |
| with: | |
| subject-name: ghcr.io/${{ github.repository_owner }}/yt-dlp | |
| subject-digest: ${{ steps.build_push.outputs.digest }} | |
| - name: Add attestations for DockerHub | |
| uses: actions/attest-build-provenance@v2 | |
| with: | |
| subject-name: ${{ secrets.DOCKERHUB_USERNAME }}/yt-dlp | |
| subject-digest: ${{ steps.build_push.outputs.digest }} |