-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (46 loc) · 1.61 KB
/
toolbox-image.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
name: Build custom toolbox image
on:
push:
branches:
- master
schedule:
- cron: '0 3 */14 * *'
workflow_dispatch: {}
env:
REGISTRY_USER: aleskandrox
IMAGE_REGISTRY: quay.io
IMAGE_NAME: fedora
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
jobs:
build-toolbox-image:
runs-on: ubuntu-latest
name: Build and Push Fedora toolbox image
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set versioned tag
id: versioned-tag
run: |
VERSIONED_TAG=$(date -u --iso-8601=minutes | sed 's/://g;s/+.*$//')-${GITHUB_SHA}
echo "VERSIONED_TAG=${VERSIONED_TAG}" >> $GITHUB_OUTPUT
- name: Build image
uses: redhat-actions/buildah-build@v2
id: build-image
with:
image: ${{ env.IMAGE_REGISTRY }}/${{ env.REGISTRY_USER }}/${{ env.IMAGE_NAME }}
oci: true
layers: true
tags: toolbox toolbox-custom-${{ steps.versioned-tag.outputs.VERSIONED_TAG }}
containerfiles: |
./os_toolbox.Containerfile
build-args: |
BASE_REPO=registry.fedoraproject.org/fedora-toolbox
BASE_TAG=testing
- name: Push to registry
uses: redhat-actions/push-to-registry@v2
with:
tags: >-
${{ env.IMAGE_REGISTRY }}/${{ env.REGISTRY_USER }}/${{ env.IMAGE_NAME }}:toolbox
${{ env.IMAGE_REGISTRY }}/${{ env.REGISTRY_USER }}/${{ env.IMAGE_NAME }}:toolbox-custom-${{ steps.versioned-tag.outputs.VERSIONED_TAG }}
username: ${{ env.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}