Skip to content

Update docker base image #1589

Update docker base image

Update docker base image #1589

Workflow file for this run

## %CopyrightBegin%
##
## Copyright Ericsson AB 2024. All Rights Reserved.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
## %CopyrightEnd%
name: Update docker base image
## Update the base image every day
on:
workflow_dispatch:
schedule:
## In UTC
- cron: '0 0 * * *'
permissions:
contents: read
## Build base images to be used by other github workflows
jobs:
build:
name: Update base Erlang/OTP build images
if: github.repository == 'erlang/otp'
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
strategy:
matrix:
type: [debian-base,ubuntu-base,i386-debian-base]
branch: [master, maint, maint-26, maint-27]
fail-fast: false
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # ratchet:actions/[email protected]
with:
ref: ${{ matrix.branch }}
- name: Cleanup GH Runner
shell: bash
run: .github/scripts/cleanup_gh_runner.sh
- name: Docker login
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # ratchet:docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build base image
id: base
run: >-
BASE_TAG=ghcr.io/${{ github.repository_owner }}/otp/${{ matrix.type }}
BASE_USE_CACHE=false
.github/scripts/build-base-image.sh "${{ matrix.branch }}"
- name: Push master image
if: matrix.branch == 'master'
run: docker push ${{ steps.base.outputs.BASE_TAG }}:latest
- name: Tag and push base image
run: |
docker tag ${{ steps.base.outputs.BASE_TAG }}:latest \
${{ steps.base.outputs.BASE_TAG }}:${{ matrix.branch }}
docker push ${{ steps.base.outputs.BASE_TAG }}:${{ matrix.branch }}