diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 56e364b..d6826f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,3 +45,39 @@ jobs: - uses: dtolnay/rust-toolchain@stable - name: Run tests run: cargo test --all-features --all-targets + + docker-release: + needs: [fmt, clippy, test] + if: ${{ github.ref == 'refs/heads/main' }} + runs-on: ubuntu-latest + strategy: + matrix: + include: + - build_args: | + BIN_NAME=broker-2-http + app_name: broker-2-http + - build_args: | + BIN_NAME=http-2-broker + app_name: http-2-broker + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Log into registry ghcr.io + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push ${{ matrix.app_name }} + uses: docker/build-push-action@v6 + with: + context: . + build-args: ${{ matrix.build_args }} + tags: | + ghcr.io/INTERSECT-SDK/broker-http-proxy/${{ matrix.app_name }}:latest + ghcr.io/INTERSECT-SDK/broker-http-proxy/${{ matrix.app_name }}:${{ github.sha }} + push: true diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml deleted file mode 100644 index 3429a3a..0000000 --- a/.github/workflows/docker-release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Docker - -on: - workflow_run: - workflows: ["CI"] - branches: ["main"] - types: ["completed"] - -jobs: - docker-release: - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - strategy: - matrix: - include: - - build_args: | - BIN_NAME=broker-2-http - app_name: broker-2-http - - build_args: | - BIN_NAME=http-2-broker - app_name: http-2-broker - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Log into registry ghcr.io - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push ${{ matrix.app_name }} - uses: docker/build-push-action@v6 - with: - context: . - build-args: ${{ matrix.build_args }} - tags: | - ghcr.io/INTERSECT-SDK/broker-http-proxy/${{ matrix.app_name }}:latest - ghcr.io/INTERSECT-SDK/broker-http-proxy/${{ matrix.app_name }}:${{ github.sha }} - push: true diff --git a/.github/workflows/helm-release.yml b/.github/workflows/helm-release.yml index bd689c0..555aef7 100644 --- a/.github/workflows/helm-release.yml +++ b/.github/workflows/helm-release.yml @@ -1,14 +1,16 @@ name: Helm on: - workflow_run: - workflows: ["CI"] - branches: ["main"] - types: ["completed"] + push: + branches: + - "main" + #paths: + #- "broker-2-http/charts/**" + #- "http-2-broker/charts/**" + workflow_dispatch: jobs: helm-release: - if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest permissions: contents: write