2 changed files with 53 additions and 0 deletions
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
# See https://docs.earthly.dev/ci-integration/vendor-specific-guides/gh-actions-integration |
||||
# for details. |
||||
|
||||
name: Build nightly docker |
||||
|
||||
on: |
||||
workflow_dispatch: |
||||
schedule: |
||||
- cron: '0 2 * * *' |
||||
|
||||
jobs: |
||||
Docker: |
||||
runs-on: ubuntu-latest |
||||
steps: |
||||
- name: Download latest earthly |
||||
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.6.14/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" |
||||
|
||||
- name: Earthly version |
||||
run: earthly --version |
||||
|
||||
- name: Log into GitHub Container Registry |
||||
env: |
||||
GH_CR_PAT: ${{ secrets.GH_CR_PAT }} |
||||
run: echo "${{ secrets.GH_CR_PAT }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin |
||||
if: env.GH_CR_PAT != null |
||||
|
||||
- uses: actions/checkout@v3 |
||||
- name: Checkout and build |
||||
if: env.GH_CR_PAT != null |
||||
env: |
||||
GH_CR_PAT: ${{ secrets.GH_CR_PAT }} |
||||
run: | |
||||
branch="" |
||||
if [ -n "$GITHUB_HEAD_REF" ]; then |
||||
branch="$GITHUB_HEAD_REF" |
||||
else |
||||
branch="${GITHUB_REF##*/}" |
||||
fi |
||||
git checkout -b "$branch" || true |
||||
cd build/release && ./docker-nightly-earthly.sh |
||||
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh |
||||
|
||||
# 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-earthly" |
||||
DATE=$(date +"%Y%m%d") |
||||
VERSION="${DATE}-nightly" |
||||
|
||||
echo "Building Docker image ${DOCKER_IMAGE}..." |
||||
|
||||
earthly --ci --push +docker --image="ghcr.io/owncast/${DOCKER_IMAGE}" --tag=nightly --version=${VERSION} |
||||
|
||||
# docker push ghcr.io/owncast/${DOCKER_IMAGE}:nightly |
||||
Loading…
Reference in new issue