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

Saved docker as release artifact #102

Saved docker as release artifact

Saved docker as release artifact #102

Workflow file for this run

name: Build RTME
env:
DOCKER_HUB_REPO: "dolbyio/real-time-media-extensions"
on:
pull_request:
branches:
- main
push:
tags:
- '*'
jobs:
build-resources:
runs-on: ubuntu-20.04
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get --quiet update
sudo apt-get --quiet install python3-pkg-resources python3-pip ninja-build libcurl4-openssl-dev libssl-dev libpulse-dev
sudo apt purge cmake
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
export DEBIAN_FRONTEND=noninteractive
sudo -E apt-get --quiet update --yes && sudo -E apt-get --quiet install --yes cmake
- name: Install golang
uses: actions/setup-go@v4
with:
go-version: '1.20.7'
- name: Build RTME resources
run: |
bash setup/linux.sh
- name: Prepare docker resources for upload
if: github.ref_type == 'tag'
run: |
zip -r docker-resource.zip build_docker_dir/
- name: Upload docker resources
if: github.ref_type == 'tag'
uses: actions/upload-artifact@v3
with:
name: docker-resource
path: docker-resource.zip
retention-days: 1
# Disable this job for now until repo is set
build-deploy-docker:
if: false
runs-on: ubuntu-20.04
needs: build-resources
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Download docker resources
uses: actions/download-artifact@v3
with:
name: docker-resource
- name: Prepare docker sources
run: |
unzip docker-resource.zip && rm docker-resource.zip
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.DOCKER_HUB_REPO }}
tags: ${GITHUB_REF_NAME}
- name: Build and publish docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
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