Skip to content

chore: update node base image for release #232

chore: update node base image for release

chore: update node base image for release #232

Workflow file for this run

name: Build images and push (on master branch or on schedule)
on:
push:
branches:
- "**"
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
base-image-tag: [18-bullseye, 18-bookworm, 20-bookworm, 22-bookworm]
steps:
- uses: actions/checkout@master
- name: Determine Java version
id: java_version
run: |
if [[ "${{ matrix.base-image-tag }}" == *"-bullseye" ]]; then
echo 'version=11' >> $GITHUB_OUTPUT
else
echo 'version=17' >> $GITHUB_OUTPUT
fi
- name: Test
run: |
chmod +x runTests.sh && ./runTests.sh ${{ matrix.base-image-tag }} ${{ steps.java_version.outputs.version }}
- name: Build
run: |
docker build --build-arg=BASE_IMAGE_TAG=${{ matrix.base-image-tag }} --build-arg=JAVA_VERSION=${{ steps.java_version.outputs.version }} --tag ppiper/node-browsers:${{ matrix.base-image-tag }} .
docker tag ppiper/node-browsers:${{ matrix.base-image-tag }} ghcr.io/sap/ppiper-node-browsers:${{ matrix.base-image-tag }}
- name: Tag latest image
if: ${{ matrix.base-image-tag == '22-bookworm' }}
run: |
docker tag ppiper/node-browsers:${{ matrix.base-image-tag }} ppiper/node-browsers:latest
docker tag ghcr.io/sap/ppiper-node-browsers:${{ matrix.base-image-tag }} ghcr.io/sap/ppiper-node-browsers:latest
- name: Push
if: ${{ github.ref == 'refs/heads/master' }}
run: |
echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ secrets.DOCKERHUB_USER }} --password-stdin
echo "${{ secrets.CR_PAT }}" | docker login https://ghcr.io -u ${{ secrets.CR_USER }} --password-stdin
docker push ppiper/node-browsers:${{ matrix.base-image-tag }}
docker push ghcr.io/sap/ppiper-node-browsers:${{ matrix.base-image-tag }}
if [ "${{ matrix.base-image-tag }}" == 22-bookworm ]; then
docker push ppiper/node-browsers:latest
docker push ghcr.io/sap/ppiper-node-browsers:latest
fi