Merge pull request #1789 from adoptium/dependabot/github_actions/gith… #939
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: Docker Build (Adoptium) | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main, production ] | |
| permissions: | |
| id-token: write | |
| contents: read | |
| jobs: | |
| docker-build: | |
| if: startsWith(github.repository, 'adoptium/') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Login to Azure | |
| uses: ./.github/actions/azure-login | |
| with: | |
| AZURE_CLIENT_ID_OIDC: ${{ secrets.AZURE_CLIENT_ID_OIDC }} | |
| AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} | |
| AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| - name: Detect Branch | |
| run: | | |
| case ${GITHUB_REF##*/} in | |
| production) echo "NAMESPACE=api" >> $GITHUB_ENV ;; | |
| *) echo "NAMESPACE=api-staging" >> $GITHUB_ENV ;; | |
| esac | |
| - name: Build container image and push to Azure | |
| uses: ./.github/actions/docker-build | |
| with: | |
| DOCKER_REPO: adoptopenjdkacr.azurecr.io/adoptopenjdk-${{ env.NAMESPACE }} | |
| DOCKER_FILE: ./deploy/Dockerfile | |
| - name: Build mongo container image and push to Azure | |
| uses: ./.github/actions/docker-build | |
| with: | |
| DOCKER_REPO: adoptopenjdkacr.azurecr.io/api-mongodb-${{ env.NAMESPACE }} | |
| DOCKER_FILE: ./deploy/mongo/Dockerfile | |
| - name: Redeploy Kubernetes Updater and Frontend | |
| uses: ./.github/actions/kubectl-redeploy | |
| with: | |
| NAMESPACE: ${{ env.NAMESPACE }} |