mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
Currently the Docker image build regularly fails with "no space left on disk". We try to delete additional files and docker images to try to avoid that error.
86 lines
2.8 KiB
YAML
86 lines
2.8 KiB
YAML
name: Docker image build
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
schedule:
|
|
# Every day at midnight (UTC).
|
|
- cron: '0 0 * * *'
|
|
# Manual trigger through the UI for testing.
|
|
workflow_dispatch:
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
env:
|
|
DOCKER_ORG: lightninglabs
|
|
DOCKER_REPO: lightning-terminal
|
|
NIGHTLY_DOCKER_REPO: lightning-terminal-nightly
|
|
NIGHTLY_BRANCH_NAME: master
|
|
NIGHTLY_TAG_NAME: experimental-daily-testing
|
|
|
|
jobs:
|
|
main:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: cleanup space
|
|
run: rm -rf /opt/hostedtoolcache
|
|
|
|
- name: Set up QEMU
|
|
uses: lightninglabs/gh-actions/setup-qemu-action@2021.01.25.00
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: lightninglabs/gh-actions/setup-buildx-action@2021.01.25.00
|
|
|
|
- name: Login to DockerHub
|
|
uses: lightninglabs/gh-actions/login-action@2021.01.25.00
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_API_KEY }}
|
|
|
|
# Make it possible to use different values for the version (used for git
|
|
# checkout) and the image tag (used for the docker image tag).
|
|
- name: Set env
|
|
run: |
|
|
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
echo "IMAGE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
|
|
# The daily/nightly build (or manual trigger) will always use the
|
|
# experimental branch and push to a different docker repo.
|
|
- name: Set daily tag
|
|
if: ${{ github.event.schedule == '0 0 * * *' || github.event_name == 'workflow_dispatch' }}
|
|
run: |
|
|
echo "RELEASE_VERSION=${{env.NIGHTLY_BRANCH_NAME}}" >> $GITHUB_ENV
|
|
echo "DOCKER_REPO=${{env.NIGHTLY_DOCKER_REPO}}" >> $GITHUB_ENV
|
|
echo "IMAGE_TAG=${{env.NIGHTLY_TAG_NAME}}-$(date -u +%Y%m%d)" >> $GITHUB_ENV
|
|
|
|
- name: Build and push default image
|
|
id: docker_build
|
|
uses: lightninglabs/gh-actions/build-push-action@2021.01.25.00
|
|
with:
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: "${{ env.DOCKER_ORG }}/${{ env.DOCKER_REPO }}:${{ env.IMAGE_TAG }}"
|
|
build-args: checkout=${{ env.RELEASE_VERSION }}
|
|
|
|
- name: Clear the Docker build cache
|
|
run: docker builder prune -a -f
|
|
|
|
- name: Clear the Docker image cache
|
|
run: docker image prune -a -f
|
|
|
|
- name: Build and push image with /lit path
|
|
id: docker_build2
|
|
uses: lightninglabs/gh-actions/build-push-action@2021.01.25.00
|
|
with:
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: "${{ env.DOCKER_ORG }}/${{ env.DOCKER_REPO }}:${{ env.IMAGE_TAG }}-path-prefix"
|
|
build-args: |
|
|
checkout=${{ env.RELEASE_VERSION }}
|
|
public_url=/lit
|
|
|
|
- name: Image digest
|
|
run: echo ${{ steps.docker_build.outputs.digest }} ${{ steps.docker_build2.outputs.digest }}
|