EIP1-9472: Fix script #2
Workflow file for this run
This file contains 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: Temp build image | |
on: | |
push: | |
branches: | |
- EIP1-9472-spring-boot-3-upgrade | |
jobs: | |
test-build: | |
# Pin to ubuntu 22.04 for as long as we manually install a specific Docker version | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: corretto | |
java-version: 17 | |
cache: gradle | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
aws-access-key-id: ${{ secrets.DEV2_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.DEV2_AWS_SECRET_ACCESS_KEY }} | |
aws-region: eu-west-2 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
# https://github.com/spring-projects/spring-boot/issues/39323 | |
# Spring Boot 2 has a bug in the way it installs buildpacks which is | |
# not compatible with Docker versions >= 25. | |
- name: Install Docker version 24 for compatibility with Spring Boot 2 | |
run: | | |
VERSION_STRING=5:24.0.9-1~ubuntu.22.04~jammy | |
sudo apt-get update | |
sudo apt-get install -y ca-certificates curl | |
sudo install -m 0755 -d /etc/apt/keyrings | |
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | |
sudo chmod a+r /etc/apt/keyrings/docker.asc | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt-get update | |
sudo apt-get install -y --allow-downgrades docker-ce=$VERSION_STRING docker-ce-cli=$VERSION_STRING containerd.io docker-buildx-plugin docker-compose-plugin | |
- name: Test build image | |
id: build-image | |
env: | |
AWS_PROFILE_ARG: "" | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
ECR_REPOSITORY: ${{ inputs.ecr_repo }} | |
run: ./gradlew bootBuildImage |