Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Docker save and set as release artifact
Browse files Browse the repository at this point in the history
- The release and tag will be created before this is run
- Use the shell script to create the docker image from sources
  -> Save the image and gzip it
  -> Upload it to created release
  • Loading branch information
djova-dolby committed Sep 5, 2023
1 parent e177730 commit 1fb9799
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 10 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build RTME

env:
DOCKER_HUB_REPO: "voxeet/real-time-media-extensions"
DOCKER_HUB_REPO: "dolbyio/real-time-media-extensions"

on:
pull_request:
Expand Down Expand Up @@ -48,9 +48,10 @@ jobs:
name: docker-resource
path: docker-resource.zip
retention-days: 1


# Disable this job for now until repo is set
build-deploy-docker:
if: github.ref_type == 'tag'
if: false
runs-on: ubuntu-20.04
needs: build-resources
steps:
Expand Down Expand Up @@ -87,3 +88,28 @@ jobs:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

build-save-docker:
if: github.ref_type == 'tag'
runs-on: ubuntu-20.04
needs: build-resources
permissions:
contents: write
packages: write
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Download docker resources
uses: actions/download-artifact@v3
with:
name: docker-resource

- name: Build, save and release docker
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
unzip docker-resource.zip && rm docker-resource.zip
sudo bash setup/linux.sh --build_docker ${{ env.DOCKER_HUB_REPO }} ${GITHUB_REF_NAME} --skip_building
sudo chmod 777 dolbyio_rtme-${GITHUB_REF_NAME}.tar.gz
gh release upload ${GITHUB_REF_NAME} dolbyio_rtme-${GITHUB_REF_NAME}.tar.gz
15 changes: 8 additions & 7 deletions setup/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ prepare_docker_image() {
}

build_docker_image() {
docker_repo=${1}
docker_tag=${2}
pushd ${WORK_DIR}
docker build -t ${docker_repo}:${docker_tag} -f Dockerfile --no-cache .
docker save --output dolbyio_rtme-${docker_tag}.tar ${docker_repo}:${docker_tag}
gzip -9 dolbyio_rtme-${docker_tag}.tar
popd
docker_repo=${1}
docker_tag=${2}
pushd ${WORK_DIR}
docker build -t ${docker_repo}:${docker_tag} -f Dockerfile --no-cache .
docker save --output dolbyio_rtme-${docker_tag}.tar ${docker_repo}:${docker_tag}
gzip -9 dolbyio_rtme-${docker_tag}.tar
ls -l
popd
}

0 comments on commit 1fb9799

Please sign in to comment.