From 7573e215928a214db103ef438bb48b2e7b5a86e8 Mon Sep 17 00:00:00 2001 From: ShahanaFarooqui Date: Fri, 24 May 2024 11:07:34 -0700 Subject: [PATCH] docker: Testing docker publishing via github action Testing version for PR #https://github.com/ElementsProject/lightning/pull/7331. Updated Actions --- .github/workflows/docker-release.yml | 48 ++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/docker-release.yml diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml new file mode 100644 index 000000000000..62e36e787593 --- /dev/null +++ b/.github/workflows/docker-release.yml @@ -0,0 +1,48 @@ +name: Build and push multi-platform docker images + +on: + push: + tags: + - '^v[0-9]{2}\.[0-9]{2}(\.[0-9]{1,2})?$' + workflow_dispatch: + inputs: + version: + description: 'Release version' + required: true + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Cache Docker layers + uses: actions/cache@v2 + with: + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-buildx- + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64,linux/arm/v7 + tags: | + shahanafarooqui/lightningd:${{ github.event.inputs.version }} + shahanafarooqui/lightningd:latest + cache-from: type=local,src=/tmp/.buildx-cache + cache-to: type=local,dest=/tmp/.buildx-cache