forked from apple/foundationdb
-
Notifications
You must be signed in to change notification settings - Fork 6
63 lines (52 loc) · 1.79 KB
/
make-build-image.yml
File metadata and controls
63 lines (52 loc) · 1.79 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
---
name: Make a build image
on:
push:
tags: ["*.ow-build-image"]
jobs:
calc_ver:
# calculate versions from git tags
runs-on: ubuntu-latest
outputs:
project_ver: ${{steps.vers.outputs.project_ver}}
build_ver: ${{steps.vers.outputs.build_ver}}
full_ver: ${{steps.vers.outputs.full_ver}}
release_flag: ${{steps.vers.outputs.release_flag}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Calculate versions
id: vers
shell: bash
run: ${{github.workspace}}/build-scripts/for-github/calc-version-from-git.bash
build-image:
needs: [calc_ver]
permissions: write-all
strategy:
matrix:
include:
- run_on: ubuntu-latest
for: linux
prepare: debian-based
base_image: debian:10
image_name: foundationdb-build
env:
IMAGE_NAME: ${{ matrix.image_name }}:${{ needs.calc_ver.outputs.full_ver }}
runs-on: ${{ matrix.run_on }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build an image
run: |
podman build \
-v ${{github.workspace}}:/mnt/project:ro,Z \
-f ${{github.workspace}}/build-scripts/for-${{ matrix.for }}/build-${{ matrix.prepare }}.Dockerfile \
--build-arg IMAGE=${{ matrix.base_image }} \
--build-arg PROJECT_NAME=foundationdb \
--build-arg FOR_OS=${{ matrix.for }} \
-t $IMAGE_NAME
- name: Log in to registry
# This is where you will update the personal access token to GITHUB_TOKEN
run: echo "${{ secrets.GITHUB_TOKEN }}" | podman login ghcr.io -u $ --password-stdin
- name: Push image
run: podman push $IMAGE_NAME ghcr.io/${GITHUB_REPOSITORY_OWNER@L}/$IMAGE_NAME