-
Notifications
You must be signed in to change notification settings - Fork 3k
51 lines (45 loc) · 1.46 KB
/
update-base.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Update docker base image
## Update the base image every day
on:
workflow_dispatch:
schedule:
## In UTC
- cron: '0 0 * * *'
## 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:
contents: read
packages: write
strategy:
matrix:
type: [debian-base,ubuntu-base,i386-debian-base]
branch: [master, maint, maint-26]
fail-fast: false
steps:
- uses: actions/[email protected]
with:
ref: ${{ matrix.branch }}
- name: Docker login
uses: 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 }}