Skip to content

Commit

Permalink
chore: push docker images in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed May 27, 2023
1 parent 4ef93a9 commit 26dc356
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,31 @@ jobs:
build:
runs-on: ubuntu-latest

permissions:
packages: write

steps:
- uses: actions/checkout@v3

- name: Run build
- name: Login to GitHub Container Registry
if: ${{ env.has_token == true }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
has_token: ${{ !!secrets.GITHUB_TOKEN && github.repository_owner == 'casparcg' }}

- name: Prepare dependencies
run: |
./tools/linux/ensure-base-images
env:
CI: 1
CASPARCG_PUSH_IMAGES: ${{ !!secrets.GITHUB_TOKEN && github.repository_owner == 'casparcg' }}

- name: Run build
run: |
./tools/linux/build-in-docker
./tools/linux/extract-from-docker
Expand Down
7 changes: 6 additions & 1 deletion tools/linux/ensure-base-images
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,9 @@ docker pull $IMAGE_CEF || docker build -t $IMAGE_CEF --build-arg PROC_COUNT --bu
docker pull $IMAGE_BOOST || docker build -t $IMAGE_BOOST --build-arg PROC_COUNT --build-arg IMAGE_BASE tools/linux/boost
docker pull $IMAGE_FFMPEG || docker build -t $IMAGE_FFMPEG --build-arg PROC_COUNT --build-arg IMAGE_BASE tools/linux/ffmpeg

# TODO - push images if auth variables are defined
if [ "$CASPARCG_PUSH_IMAGES" = true ]; then
docker push $IMAGE_BASE
docker push $IMAGE_CEF
docker push $IMAGE_BOOST
docker push $IMAGE_FFMPEG
fi

0 comments on commit 26dc356

Please sign in to comment.