Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ on:

permissions:
contents: read
packages: read

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -317,6 +318,17 @@ jobs:
submodules: recursive
fetch-depth: 0

- name: Check if Dockerfile.base changed
id: base_changed
shell: bash
run: |
set -euo pipefail
if git diff --name-only "origin/${{ github.base_ref }}...HEAD" | grep -q '^docker/Dockerfile\.base$'; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi

- name: Free disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
Expand All @@ -328,7 +340,21 @@ jobs:
docker-images: true
swap-storage: true

- name: Pull base image from GHCR
if: steps.base_changed.outputs.changed == 'false'
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euxo pipefail
owner="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')"
echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
docker pull "ghcr.io/${owner}/client-sdk-cpp-base:base-main-amd64"
docker tag "ghcr.io/${owner}/client-sdk-cpp-base:base-main-amd64" \
"livekit-cpp-sdk-base-x64:${{ github.sha }}"

- name: Build base Docker image
if: steps.base_changed.outputs.changed == 'true'
run: |
docker build \
--build-arg TARGETARCH=amd64 \
Expand Down Expand Up @@ -372,6 +398,17 @@ jobs:
submodules: recursive
fetch-depth: 0

- name: Check if Dockerfile.base changed
id: base_changed
shell: bash
run: |
set -euo pipefail
if git diff --name-only "origin/${{ github.base_ref }}...HEAD" | grep -q '^docker/Dockerfile\.base$'; then
echo "changed=true" >> "$GITHUB_OUTPUT"
else
echo "changed=false" >> "$GITHUB_OUTPUT"
fi

- name: Free disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
Expand All @@ -383,7 +420,21 @@ jobs:
docker-images: true
swap-storage: true

- name: Pull base image from GHCR
if: steps.base_changed.outputs.changed == 'false'
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euxo pipefail
owner="$(echo "${GITHUB_REPOSITORY_OWNER}" | tr '[:upper:]' '[:lower:]')"
echo "${GITHUB_TOKEN}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin
docker pull "ghcr.io/${owner}/client-sdk-cpp-base:base-main-arm64"
docker tag "ghcr.io/${owner}/client-sdk-cpp-base:base-main-arm64" \
"livekit-cpp-sdk-base-arm64:${{ github.sha }}"

- name: Build base Docker image
if: steps.base_changed.outputs.changed == 'true'
run: |
docker build \
--build-arg TARGETARCH=arm64 \
Expand Down
Loading