Skip to content

Merge pull request #1195 from adoptium/dependabot/github_actions/dot-… #436

Merge pull request #1195 from adoptium/dependabot/github_actions/dot-…

Merge pull request #1195 from adoptium/dependabot/github_actions/dot-… #436

name: Docker Build (AdoptOpenJDK)
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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- 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 }}
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
- name: Detect Branch
run: |
case ${GITHUB_REF##*/} in
production) echo "NAMESPACE=adoptopenjdk-alt" >> $GITHUB_ENV ;;
*) echo "NAMESPACE=adoptopenjdk-alt-staging" >> $GITHUB_ENV ;;
esac
- name: Build container image and push to Azure
uses: ./.github/actions/docker-build
with:
DOCKER_REPO: adoptopenjdkacr.azurecr.io/azure-${{ env.NAMESPACE }}
DOCKER_FILE: ./deploy/Dockerfile
BUILD_ARGS: MAVEN_FLAGS="-Padoptopenjdk,-adoptium"
- name: Redeploy Kubernetes Updater and Frontend
uses: ./.github/actions/kubectl-redeploy
with:
NAMESPACE: ${{ env.NAMESPACE }}
# if the branch is production, redeploy the k8s service on digitalocean too
- name: Login to DigitalOcean
uses: ./.github/actions/do-login
with:
DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Redeploy Kubernetes Updater and Frontend
if: startsWith(github.ref, 'refs/heads/production')
uses: ./.github/actions/kubectl-redeploy
with:
NAMESPACE: adoptopenjdk-do