0

build docker image every night

This commit is contained in:
Gabe Kangas 2021-03-29 19:07:29 -07:00
parent 592d207ec3
commit bf93d2decc
2 changed files with 36 additions and 0 deletions

17
.github/workflows/docker-nightly.yaml vendored Normal file
View File

@ -0,0 +1,17 @@
name: Build nightly docker
on:
schedule:
- cron: "0 0 * * *"
jobs:
Docker:
runs-on: ubuntu-latest
steps:
- name: Log into GitHub Container Registry
run: echo "${{ secrets.GH_CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
- uses: actions/checkout@v2
- name: Setup and run
run: cd build/release && ./docker-nightly.sh

19
build/release/docker-nightly.sh Executable file
View File

@ -0,0 +1,19 @@
# Docker build
# Must authenticate first: https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-to-github-packages
DOCKER_IMAGE="owncast"
VERSION="nightly"
GIT_COMMIT=$(git rev-list -1 HEAD)
echo "Building Docker image ${DOCKER_IMAGE}..."
# Change to the root directory of the repository
cd $(git rev-parse --show-toplevel)
# Docker build
docker build --build-arg NAME=docker --build-arg VERSION=${VERSION} --build-arg GIT_COMMIT=$GIT_COMMIT -t ghcr.io/owncast/${DOCKER_IMAGE}:nightly . -f build/release/Dockerfile-build
# Dockerhub
# You must be authenticated via `docker login` with your Dockerhub credentials first.
# docker push gabekangas/owncast:nightly
docker push ghcr.io/owncast/${DOCKER_IMAGE}:nightly