Skip to content

Commit

Permalink
Use build-push-action for build deploy dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Feb 11, 2023
1 parent 537ffbd commit 1270e27
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-BETA-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-DEV-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
40 changes: 28 additions & 12 deletions .github/workflows/deploy-DEV.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
###################################
Expand Down Expand Up @@ -133,25 +145,29 @@ 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) ||
(github.event_name == 'push' && github.repository == 'oxsecurity/megalinter')
)
&&
!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: linters/${{ matrix.linter }}/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
Expand Down

0 comments on commit 1270e27

Please sign in to comment.