From 848d9d911dafde9e2806f130a569b11196502f88 Mon Sep 17 00:00:00 2001 From: Lukas Gravley Date: Fri, 4 Dec 2020 17:15:51 -0600 Subject: [PATCH] much better (#1059) * much better * kill spaces --- .github/workflows/deploy-PROD.yml | 53 +++++++++++++++----------- .github/workflows/deploy-RELEASE.yml | 57 +++++++++++++++++----------- 2 files changed, 65 insertions(+), 45 deletions(-) diff --git a/.github/workflows/deploy-PROD.yml b/.github/workflows/deploy-PROD.yml index 9d2ee7ad..42cdc8d3 100644 --- a/.github/workflows/deploy-PROD.yml +++ b/.github/workflows/deploy-PROD.yml @@ -45,31 +45,40 @@ jobs: - name: Get current date run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${GITHUB_ENV} - ##################### - # Run Deploy script # - ##################### - - name: Deploy latest image to DockerHub - uses: whoan/docker-build-with-cache-action@v5 + ############################### + # Login to DockerHub registry # + ############################### + - name: Login to DockerHub + uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - image_name: github/super-linter - image_tag: "latest,v3" - dockerfile: Dockerfile - build_extra_args: "--build-arg=BUILD_DATE=${{ env.BUILD_DATE }} --build-arg=BUILD_REVISION=${{ github.sha }} --build-arg=BUILD_VERSION=${{ github.sha }}" - push_image_and_stages: true - ############################# - # Run Deploy script for GPR # - ############################# - - name: Deploy Latest image to GitHub Container Registry - uses: whoan/docker-build-with-cache-action@v5 + ###################################### + # Login to GitHub Container registry # + ###################################### + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 with: - username: ${{ secrets.GCR_USERNAME }} - password: ${{ secrets.GCR_TOKEN }} registry: ghcr.io - image_name: github/super-linter - image_tag: "latest,v3" - dockerfile: Dockerfile - build_extra_args: "--build-arg=BUILD_DATE=${{ env.BUILD_DATE }} --build-arg=BUILD_REVISION=$${{ github.sha }} --build-arg=BUILD_VERSION=${{ github.sha }}" - push_image_and_stages: true + username: ${{ github.GCR_USERNAME }} + password: ${{ secrets.GCR_TOKEN }} + + ########################################### + # Build and Push containers to registries # + ########################################### + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + build-args: | + BUILD_DATE=${{ env.BUILD_DATE }} + BUILD_REVISION=${{ github.sha }} + BUILD_VERSION=${{ github.sha }} + push: true + tags: | + github/super-linter:latest + github/super-linter:v3 + ghcr.io/github/super-linter:latest + ghcr.io/github/super-linter:v3 diff --git a/.github/workflows/deploy-RELEASE.yml b/.github/workflows/deploy-RELEASE.yml index c267e037..dd0d1b68 100644 --- a/.github/workflows/deploy-RELEASE.yml +++ b/.github/workflows/deploy-RELEASE.yml @@ -45,31 +45,42 @@ jobs: - name: Get current date run: echo "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> ${GITHUB_ENV} - ################################### - # Run Deploy script for Dockerhub # - ################################### - - name: Deploy Release image to Dockerhub - uses: whoan/docker-build-with-cache-action@v5 + ############################### + # Login to DockerHub registry # + ############################### + - name: Login to DockerHub + uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - image_name: github/super-linter - image_tag: ${{ github.event.release.tag_name }} - dockerfile: Dockerfile - build_extra_args: "--build-arg=BUILD_DATE=${{ env.BUILD_DATE }} --build-arg=BUILD_REVISION=${{ github.sha }} --build-arg=BUILD_VERSION=${{ github.sha }}" - push_image_and_stages: true - ################################################### - # Run Deploy script for GitHub Container Registry # - ################################################### - - name: Deploy Release image to GitHub Container Registry - uses: whoan/docker-build-with-cache-action@v5 + ###################################### + # Login to GitHub Container registry # + ###################################### + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 with: - username: ${{ secrets.GCR_USERNAME }} - password: ${{ secrets.GCR_PASSWORD }} - repository: ghcr.io - image_name: github/super-linter - image_tag: ${{ github.event.release.tag_name }} - dockerfile: Dockerfile - build_extra_args: "--build-arg=BUILD_DATE=${{ github.event.timestamp }}Z --build-arg=BUILD_REVISION=${{ github.sha }} --build-arg=BUILD_VERSION=${{ github.sha }}" - push_image_and_stages: true + registry: ghcr.io + username: ${{ github.GCR_USERNAME }} + password: ${{ secrets.GCR_TOKEN }} + + ########################################### + # Build and Push containers to registries # + ########################################### + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + build-args: | + BUILD_DATE=${{ env.BUILD_DATE }} + BUILD_REVISION=${{ github.sha }} + BUILD_VERSION=${{ github.sha }} + push: true + tags: | + github/super-linter:latest + github/super-linter:v3 + github/super-linter:${{ github.event.release.tag_name }} + ghcr.io/github/super-linter:latest + ghcr.io/github/super-linter:v3 + ghcr.io/github/super-linter:${{ github.event.release.tag_name }}