-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (60 loc) · 2.16 KB
/
build-fcos-k8s.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
name: Build fcos-k8s
on:
workflow_dispatch:
workflow_call:
push:
branches: [main]
paths:
- "apps/fcos-k8s/Dockerfile"
- "apps/fcos-k8s/*.sh"
pull_request:
branches: [main]
paths:
- "apps/fcos-k8s/Dockerfile"
- "apps/fcos-k8s/*.sh"
- ".github/workflows/build-fcos-k8s.yaml"
merge_group:
branches: ["main"]
jobs:
metadata:
runs-on: ubuntu-latest
strategy:
fail-fast: false
permissions:
contents: read
outputs:
kubernetes-version: "${{ steps.version.outputs.kubernetes-version }}"
kubernetes-short-version: "${{ steps.version.outputs.kubernetes-short-version }}"
fcos-version: "${{ steps.version.outputs.fcos-version }}"
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Extract kubernetes and fcos version
id: version
run: |
set -ex
VERSION_STRING="$(grep "ENV KUBERNETES_VERSION=" apps/fcos-k8s/Dockerfile)"
VERSION="$(echo "${VERSION_STRING}" | awk -F'=' '{print $2}' | tr -d '"')"
echo "kubernetes-version=v${VERSION}" >> "$GITHUB_OUTPUT"
echo "kubernetes-short-version=v${VERSION%.*}" >> "$GITHUB_OUTPUT"
CONTAINER_IMAGE="$(grep "FROM quay.io/fedora/fedora-coreos" apps/fcos-k8s/Dockerfile | awk -F' ' '{print $2}')"
podman run -t "${CONTAINER_IMAGE}" cat /etc/os-release > os-release
source os-release
echo "fcos-version=${OSTREE_VERSION}" >> "$GITHUB_OUTPUT"
build:
uses: heathcliff26/ci/.github/workflows/build-container.yaml@main
needs: metadata
permissions:
contents: read
packages: write
with:
app: fcos-k8s
tag: "${{ needs.metadata.outputs.kubernetes-short-version }}"
tags: |
${{ needs.metadata.outputs.kubernetes-version }}"
"${{ needs.metadata.outputs.kubernetes-version }}-${{ needs.metadata.outputs.fcos-version }}"
"type=raw,value=latest,enable={{is_default_branch}}
dry-run: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
context: apps/fcos-k8s
secrets: inherit