diff --git a/.github/workflows/harbour-build-server.yml b/.github/workflows/harbour-build-server.yml index 1e28663bf..b77265c9b 100644 --- a/.github/workflows/harbour-build-server.yml +++ b/.github/workflows/harbour-build-server.yml @@ -11,6 +11,8 @@ jobs: needs: python-tests name: Build and export server image runs-on: ubuntu-20.04 + outputs: + image-id: ${{ steps.build.outputs.image-id }} steps: - uses: actions/checkout@v3 @@ -20,7 +22,8 @@ jobs: run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: get_branch - - name: Build and export + - id: build + name: Build and export uses: cern-sis/gh-workflows/.github/actions/docker-build@v6.1.0 with: dockerfile: ./docker/harbour/backend/Dockerfile @@ -33,3 +36,17 @@ jobs: password: ${{ secrets.HARBOR_PASSWORD }} build-args: | BRANCH_NAME=${{ steps.get_branch.outputs.BRANCH_NAME }} + deploy: + needs: build-image + name: update-image + runs-on: ubuntu-20.04 + + steps: + - name: send event + uses: cern-sis/gh-workflows/.github/actions/kubernetes-project-new-images@v6.4 + with: + event-type: update + token: ${{ secrets.PAT_FIRE_EVENTS_ON_CERN_SIS_KUBERNETES_CAP }} + repo: cern-sis/kubernetes-cap + images: | + cern-sis/cap-server@{{ needs.build-image.outputs.image-id }} diff --git a/.github/workflows/harbour-build-ui.yml b/.github/workflows/harbour-build-ui.yml index 635b25fe2..217c32d18 100644 --- a/.github/workflows/harbour-build-ui.yml +++ b/.github/workflows/harbour-build-ui.yml @@ -12,6 +12,8 @@ jobs: needs: UITest name: Build and export ui image runs-on: ubuntu-20.04 + outputs: + image-id: ${{ steps.build-ui.outputs.image-id }} steps: - uses: actions/checkout@v3 @@ -21,7 +23,8 @@ jobs: run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT id: get_branch - - name: Build and export + - id: build-ui + name: Build and export uses: cern-sis/gh-workflows/.github/actions/docker-build@v6.1.0 with: dockerfile: ./docker/harbour/ui/Dockerfile @@ -41,7 +44,8 @@ jobs: CAP_PIWIK_SITEID_QA=${{ secrets.CAP_PIWIK_SITEID_QA }} CAP_PIWIK_SITEID_TEST=${{ secrets.CAP_PIWIK_SITEID_TEST }} - - name: Build and export for end to end image + - id: build-ui-e2e + name: Build and export for end to end image uses: cern-sis/gh-workflows/.github/actions/docker-build@v6.1.0 if: ${{ steps.get_branch.outputs.BRANCH_NAME }} == 'qa' with: @@ -59,3 +63,19 @@ jobs: PIWIK_ENV=${{ steps.get_branch.outputs.BRANCH_NAME }} CAP_PIWIK_URL=${{ secrets.CAP_PIWIK_URL }} CAP_PIWIK_SITEID_QA=${{ secrets.CAP_PIWIK_SITEID_QA }} + + deploy: + needs: build-image + name: update-image + runs-on: ubuntu-20.04 + + steps: + - name: send event + uses: cern-sis/gh-workflows/.github/actions/kubernetes-project-new-images@v6.4 + with: + event-type: update + token: ${{ secrets.PAT_FIRE_EVENTS_ON_CERN_SIS_KUBERNETES_CAP }} + repo: cern-sis/kubernetes-cap + images: | + cern-sis/cap-ui@{{ needs.build-image.outputs.image-id }} +