Skip to content

Follow ffmpeg's buffer behavior to reduce playback issues on slow connections #179

Follow ffmpeg's buffer behavior to reduce playback issues on slow connections

Follow ffmpeg's buffer behavior to reduce playback issues on slow connections #179

Workflow file for this run

name: Pull Request Publish
on:
issue_comment:
types:
- created
jobs:
fetch-pr-details:
if: ${{ github.event.comment.body == '/publish' && github.event.issue.pull_request }}
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.get-sha.outputs.result }}
steps:
- name: Get PR SHA
id: get-sha
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const prNumber = context.issue.number;
const response = await github.rest.pulls.get({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber
});
const sha = response.data.head.sha;
return sha;
build-and-push:
needs: fetch-pr-details
if: ${{ github.event.comment.body == '/publish' && github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ needs.fetch-pr-details.outputs.sha }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_PAT }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker - Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
tags: type=raw,value=pr-${{ github.event.issue.number }}
flavor: latest=false
- name: Docker - Build and Push
uses: docker/build-push-action@v5
with:
context: "https://github.com/${{ github.repository }}.git#${{ needs.fetch-pr-details.outputs.sha }}"
push: true
tags: ${{ steps.meta.outputs.tags }}
- name: Comment on Pull Request with Container Image URL
if: success()
uses: marocchino/sticky-pull-request-comment@v2
with:
header: Built and pushed Docker image for PR
recreate: true
number: ${{ github.event.issue.number }}
message: |
The Docker image for this pull request has been built and pushed to GHCR.
Image URL: `ghcr.io/${{ github.repository }}:pr-${{ github.event.issue.number }}`