From 6a9df6f56e2b15566433db8e007239923dc95e87 Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 15 Sep 2024 14:35:27 -0400 Subject: [PATCH] Fixed indentation --- .gitea/workflows/build.yaml | 92 +++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index a3e7e48..d6f44b9 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -4,58 +4,60 @@ on: [push, pull_request] jobs: - runs-on: ubuntu-latest + build: - steps: - - name: Set up Docker Buildx - uses: crazy-max/ghaction-docker-buildx@v1 + runs-on: ubuntu-20.04 - - name: Checkout - uses: actions/checkout@v2 + steps: + - name: Set up Docker Buildx + uses: crazy-max/ghaction-docker-buildx@v1 - - name: Prepare Docker build - id: prepare - run: | - function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } + - name: Checkout + uses: actions/checkout@v2 - BITCOIN_VERSION='24' - LATEST_BITCOIN_MAJOR_VERSION=$(find . -type d -maxdepth 1 -not -path '*/\.*' | sort -n | tail -n 1 | cut -c 3-) - PLATFORMS="linux/amd64" - PUSH=false - TAGS='bill/bitcoin-docker:24' + - name: Prepare Docker build + id: prepare + run: | + function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; } - echo ::set-output name=build_date::$(date -u +'%Y-%m-%dT%H:%M:%SZ') - echo ::set-output name=docker_platforms::${PLATFORMS} - echo ::set-output name=docker_username::${{ gitea.repository_owner }} - echo ::set-output name=push::${PUSH} - echo ::set-output name=tags::${TAGS} - echo ::set-output name=build::true + BITCOIN_VERSION='24' + LATEST_BITCOIN_MAJOR_VERSION=$(find . -type d -maxdepth 1 -not -path '*/\.*' | sort -n | tail -n 1 | cut -c 3-) + PLATFORMS="linux/amd64" + PUSH=false + TAGS='bill/bitcoin-docker:24' - - if: ${{ steps.prepare.outputs.build }} == 'true' - name: Login into Registry - uses: docker/login-action@v3 - with: - username: ${{ gitea.repository_owner }} - password: ${{ secrets.REGISTRY_TOKEN }} + echo ::set-output name=build_date::$(date -u +'%Y-%m-%dT%H:%M:%SZ') + echo ::set-output name=docker_platforms::${PLATFORMS} + echo ::set-output name=docker_username::${{ gitea.repository_owner }} + echo ::set-output name=push::${PUSH} + echo ::set-output name=tags::${TAGS} + echo ::set-output name=build::true - - if: ${{ steps.prepare.outputs.build }} == 'true' - name: Build Docker image - run: | - TAGS=(${{ steps.prepare.outputs.tags }}) + - if: ${{ steps.prepare.outputs.build }} == 'true' + name: Login into Registry + uses: docker/login-action@v3 + with: + username: ${{ gitea.repository_owner }} + password: ${{ secrets.REGISTRY_TOKEN }} - echo "Build date: ${{ steps.prepare.outputs.build_date }}" - echo "Docker platform: ${{ steps.prepare.outputs.docker_platforms }}" - echo "Push: ${{ steps.prepare.outputs.push }}" - echo "Tags: ${{ steps.prepare.outputs.tags }}" + - if: ${{ steps.prepare.outputs.build }} == 'true' + name: Build Docker image + run: | + TAGS=(${{ steps.prepare.outputs.tags }}) - echo docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \ - --output "type=image,push=${{steps.prepare.outputs.push}}" \ - --progress=plain \ - --build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \ - $(printf "%s" "${TAGS[@]/#/ --tag }" )/ + echo "Build date: ${{ steps.prepare.outputs.build_date }}" + echo "Docker platform: ${{ steps.prepare.outputs.docker_platforms }}" + echo "Push: ${{ steps.prepare.outputs.push }}" + echo "Tags: ${{ steps.prepare.outputs.tags }}" - docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \ - --output "type=image,push=${{steps.prepare.outputs.push}}" \ - --progress=plain \ - --build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \ - $(printf "%s" "${TAGS[@]/#/ --tag }" )/ \ No newline at end of file + echo docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \ + --output "type=image,push=${{steps.prepare.outputs.push}}" \ + --progress=plain \ + --build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \ + $(printf "%s" "${TAGS[@]/#/ --tag }" )/ + + docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \ + --output "type=image,push=${{steps.prepare.outputs.push}}" \ + --progress=plain \ + --build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \ + $(printf "%s" "${TAGS[@]/#/ --tag }" )/ \ No newline at end of file