From 85c7817d1981d824d89ff373d773160393bfad5f Mon Sep 17 00:00:00 2001 From: Dhrumil Mistry <56185972+dmdhrumilmistry@users.noreply.github.com> Date: Sat, 28 Oct 2023 19:11:32 +0530 Subject: [PATCH] fix workflow files --- .github/workflows/dev-push.yml | 2 +- .github/workflows/pypi-publish.yml | 7 ++-- .github/workflows/release-push.yml | 56 ++++++++++++++++-------------- 3 files changed, 36 insertions(+), 29 deletions(-) diff --git a/.github/workflows/dev-push.yml b/.github/workflows/dev-push.yml index 6a2d4e7..793313a 100644 --- a/.github/workflows/dev-push.yml +++ b/.github/workflows/dev-push.yml @@ -1,4 +1,4 @@ -name: "Dev Release: Build and Push Docker Image to DockerHub" +name: "Dev Release: Build and Push OWASP OFFAT Docker Images to DockerHub" on: push: diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index ac0f76b..de5bd74 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -33,9 +33,12 @@ jobs: python -m pip install --upgrade pip pip install build - name: Build package - run: python -m build + run: | + cd src + python -m build - name: Publish package uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 with: user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} \ No newline at end of file + password: ${{ secrets.PYPI_API_TOKEN }} + packages_dir: src/dist \ No newline at end of file diff --git a/.github/workflows/release-push.yml b/.github/workflows/release-push.yml index 748004f..7d24145 100644 --- a/.github/workflows/release-push.yml +++ b/.github/workflows/release-push.yml @@ -1,14 +1,16 @@ -name: "Build and Push Docker Image to DockerHub" +name: "Release: Build and Push OWASP OFFAT Docker Images to DockerHub" on: - release: - types: [published] - + push: + branches: + - "dev" jobs: - push-base-docker-image: + build-and-push-main-docker-images: runs-on: ubuntu-latest steps: + - name: Branch Checkout + uses: actions/checkout@v2 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx @@ -18,33 +20,35 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: change cwd to src directory - run: cd src - - name: Build and push + - name: Build and push offat-base docker image uses: docker/build-push-action@v3 with: - platforms: linux/amd64,linux/arm64 + context: ./src/ + file: ./src/DockerFiles/base-Dockerfile push: true - file: ./Dockerfiles/base-Dockerfile tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat-base:latest - - - push-cli-docker-image: - runs-on: ubuntu-latest - steps: - - 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 + platforms: linux/amd64,linux/arm64 + - name: Build and push offat docker image + uses: docker/build-push-action@v3 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push + context: ./src/ + file: ./src/DockerFiles/main/cli-Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat:latest + platforms: linux/amd64,linux/arm64 + - name: Build and push offat-api docker image uses: docker/build-push-action@v3 with: + context: ./src/ + file: ./src/DockerFiles/main/backend-api-Dockerfile + push: true + tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat-api:latest platforms: linux/amd64,linux/arm64 + - name: Build and push offat-api-worker docker image + uses: docker/build-push-action@v3 + with: + context: ./src/ + file: ./src/DockerFiles/main/backend-api-worker-Dockerfile push: true - file: ./src/Dockerfiles/cli-Dockerfile - tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat:latest \ No newline at end of file + tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat-api-worker:latest + platforms: linux/amd64,linux/arm64