From 39fea0b2faf01b5d2691a7235e15e271eeeaa8fe Mon Sep 17 00:00:00 2001 From: nvuillam Date: Sat, 11 Feb 2023 01:22:31 +0100 Subject: [PATCH] Use build-push-action for build deploy dev --- .github/workflows/deploy-BETA-linters.yml | 2 +- .github/workflows/deploy-DEV-linters.yml | 2 +- .github/workflows/deploy-DEV.yml | 40 ++++++++++++++++------- 3 files changed, 30 insertions(+), 14 deletions(-) diff --git a/.github/workflows/deploy-BETA-linters.yml b/.github/workflows/deploy-BETA-linters.yml index 94258a69cfe..caf16deaa15 100644 --- a/.github/workflows/deploy-BETA-linters.yml +++ b/.github/workflows/deploy-BETA-linters.yml @@ -139,7 +139,7 @@ jobs: BUILD_DATE=${{ env.BUILD_DATE }} BUILD_REVISION=${{ github.sha }} BUILD_VERSION=${{ github.sha }} - load: true + load: false push: true secrets: | GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/deploy-DEV-linters.yml b/.github/workflows/deploy-DEV-linters.yml index ab54f68542e..95b93c01fb8 100644 --- a/.github/workflows/deploy-DEV-linters.yml +++ b/.github/workflows/deploy-DEV-linters.yml @@ -122,7 +122,7 @@ jobs: BUILD_DATE=${{ env.BUILD_DATE }} BUILD_REVISION=${{ github.sha }} BUILD_VERSION=${{ github.sha }} - load: true + load: false push: true secrets: | GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/deploy-DEV.yml b/.github/workflows/deploy-DEV.yml index 69c4ce010b5..dc42c22339f 100644 --- a/.github/workflows/deploy-DEV.yml +++ b/.github/workflows/deploy-DEV.yml @@ -77,6 +77,18 @@ jobs: echo "Tag name: ${TAG}" echo "tag=${TAG}" >>"$GITHUB_OUTPUT" + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + ################################### # Build image locally for testing # ################################### @@ -133,7 +145,7 @@ jobs: #################################### # Build image (full for main repo) # #################################### - - name: Build image (full from main repo) & push + - name: Build Image (full from main repo) & push if: | ( (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || @@ -141,17 +153,21 @@ jobs: ) && !contains(github.event.head_commit.message, 'quick build') - env: - # Set the Env Vars - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - IMAGE_REPO: oxsecurity/megalinter - IMAGE_VERSION: ${{steps.image_tag.outputs.tag}} - DOCKERFILE_PATH: Dockerfile - DOCKER_BUILD_PLATFORMS: linux/amd64 - REGISTRY: Docker - shell: bash - run: .automation/upload-docker.sh + uses: docker/build-push-action@v3 + with: + context: . + file: Dockerfile + platforms: linux/amd64 + build-args: | + BUILD_DATE=${{ env.BUILD_DATE }} + BUILD_REVISION=${{ github.sha }} + BUILD_VERSION=${{ github.sha }} + load: false + push: true + secrets: | + GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} + tags: | + oxsecurity/megalinter:${{steps.image_tag.outputs.tag}} # Free disk space - name: Free Disk space