action-env/.forgejo/workflows/build.yml
Vitaliy Potyarkin b9ee619374 Use vfs storage driver for building container images
Some of our Forgejo Runners use tmpfs, which causes buildah to fail:
 * https://stackoverflow.com/questions/72651641
 * 9665efd712/troubleshooting.md (6-rootless-buildah-build-fails-when-using-overlayfs)

Instead of switching to overlayfs which may or may not work depending on
kernel module being loaded, we will use vfs because it always works.
Performance loss is not critical in our usage scenario

Signed-off-by: Vitaliy Potyarkin <v.potyarkin@yadro.com>
2024-10-25 15:49:45 +03:00

53 lines
1.4 KiB
YAML

on:
push:
pull_request:
workflow_dispatch:
jobs:
build:
name: build-${{matrix.tag}}
runs-on: docker
container: node:22-bullseye
strategy:
matrix:
tag:
- openjdk-11-maven-3.8.6
- python-3.11
- python-3.13
env:
STORAGE_DRIVER: vfs
steps:
- name: Clone git repo
uses: actions/checkout@v3
- name: List modified files
uses: tj-actions/changed-files@v45
with:
files: |
${{matrix.tag}}/**
id: changed
- name: Install Buildah
run: |-
apt update; apt install -y buildah
# STORAGE_DRIVER variable is ignored if this file does not exist
touch /etc/containers/storage.conf
if: >-
github.event_name == 'workflow_dispatch'
|| steps.changed.outputs.any_changed == 'true'
- name: Build OCI image
run: make ${{matrix.tag}}
if: >-
github.event_name == 'workflow_dispatch'
|| steps.changed.outputs.any_changed == 'true'
- name: Push image to OCI registry
run: make push-${{matrix.tag}}
if: >-
github.ref == 'refs/heads/master' &&
(github.event_name == 'workflow_dispatch' ||
(steps.changed.outputs.any_changed == 'true' && github.event_name == 'push'))
env:
REGISTRY_PASSWORD: ${{secrets.REGISTRY_PASSWORD}}