Update aks and remove filebeat #289
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build microservices | |
| on: | |
| push: | |
| branches: [ "production", "master" ] | |
| jobs: | |
| buildServices1: | |
| name: Build first part of images and push to registry | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set prod environment | |
| if: endsWith(github.ref, '/production') | |
| run: | | |
| echo "DOCKER_URL=${{ secrets.PRODUCTION_DOCKER_URL }}" >> $GITHUB_ENV | |
| - name: Set dev environment | |
| if: endsWith(github.ref, '/master') | |
| run: | | |
| echo "DOCKER_URL=${{ secrets.STAGING_DOCKER_URL }}" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Login docker dev | |
| if: endsWith(github.ref, '/master') | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.STAGING_DOCKER_USER }} | |
| password: ${{ secrets.STAGING_DOCKER_PASSWORD }} | |
| registry: ${{ secrets.STAGING_DOCKER_URL }} | |
| - name: Login docker prod | |
| if: endsWith(github.ref, '/production') | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.PRODUCTION_DOCKER_USER }} | |
| password: ${{ secrets.PRODUCTION_DOCKER_PASSWORD }} | |
| registry: ${{ secrets.PRODUCTION_DOCKER_URL }} | |
| - name: Build docker image presenation | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./cppseminar/presentation | |
| push: true | |
| tags: ${{ env.DOCKER_URL }}/services/presentation:${{ github.sha }} | |
| - name: Build docker image userservice | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./cppseminar/userservice | |
| push: true | |
| tags: ${{ env.DOCKER_URL }}/services/userservice:${{ github.sha }} | |
| - name: Build docker image submissions | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./cppseminar/submissions | |
| push: true | |
| tags: ${{ env.DOCKER_URL }}/services/submissions:${{ github.sha }} | |
| buildServices2: | |
| name: Build second part of images and push to registry | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Set prod environment | |
| if: endsWith(github.ref, '/production') | |
| run: | | |
| echo "DOCKER_URL=${{ secrets.PRODUCTION_DOCKER_URL }}" >> $GITHUB_ENV | |
| - name: Set dev environment | |
| if: endsWith(github.ref, '/master') | |
| run: | | |
| echo "DOCKER_URL=${{ secrets.STAGING_DOCKER_URL }}" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Login docker dev | |
| if: endsWith(github.ref, '/master') | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.STAGING_DOCKER_USER }} | |
| password: ${{ secrets.STAGING_DOCKER_PASSWORD }} | |
| registry: ${{ secrets.STAGING_DOCKER_URL }} | |
| - name: Login docker prod | |
| if: endsWith(github.ref, '/production') | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.PRODUCTION_DOCKER_USER }} | |
| password: ${{ secrets.PRODUCTION_DOCKER_PASSWORD }} | |
| registry: ${{ secrets.PRODUCTION_DOCKER_URL }} | |
| - name: Build docker image test service | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./cppseminar/testservice | |
| push: true | |
| tags: ${{ env.DOCKER_URL }}/services/testservice:${{ github.sha }} | |
| - name: Build docker image vm-test-server | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./cppseminar/vm-test-server | |
| push: true | |
| tags: ${{ env.DOCKER_URL }}/services/vm-test-server:${{ github.sha }} | |
| - name: Build docker image vm-test-queue | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./cppseminar/vm-test-queue | |
| push: true | |
| tags: ${{ env.DOCKER_URL }}/services/vm-test-queue:${{ github.sha }} | |
| - name: Build docker image mongo-backup | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./services/mongo-simple-backup | |
| push: true | |
| tags: ${{ env.DOCKER_URL }}/services/mongo-backup:${{ github.sha }} | |
| upgradeHelm: | |
| name: Send new version to Kubernetes | |
| runs-on: ubuntu-latest | |
| needs: [ "buildServices1", "buildServices2" ] | |
| if: false | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Deliverybot Helm Action dev | |
| if: endsWith(github.ref, '/master') | |
| uses: deliverybot/helm@v1.7.0 | |
| with: | |
| release: apcchart | |
| helm: helm3 | |
| version: ${{ github.sha }} | |
| # track: stable # Maybe in future change to canary | |
| task: upgrade | |
| namespace: default | |
| values: | | |
| releaseLabel: "${{ github.sha }}" | |
| dockerRepository: ${{ secrets.STAGING_REGISTRY }} | |
| websiteHost: ${{ secrets.STAGING_HOST }} | |
| chart: ./cppseminar/apchelm | |
| env: | |
| KUBECONFIG_FILE: ${{ secrets.STAGING_KUBECONFIG }} | |
| - name: Deliverybot Helm Action prod | |
| if: endsWith(github.ref, '/production') | |
| uses: deliverybot/helm@v1.7.0 | |
| with: | |
| release: apcprod | |
| helm: helm3 | |
| version: ${{ github.sha }} | |
| task: upgrade | |
| namespace: default | |
| value-files: "./cppseminar/apchelm/values-prod.yaml" | |
| values: | | |
| releaseLabel: "${{ github.sha }}" | |
| chart: ./cppseminar/apchelm | |
| env: | |
| KUBECONFIG_FILE: ${{ secrets.PRODUCTION_KUBECONFIG }} |