Some checks failed
Build and push OCI image / build (push) Failing after 5s
58 lines
1.6 KiB
YAML
58 lines
1.6 KiB
YAML
name: Build and push OCI image
|
||
|
||
on:
|
||
push:
|
||
branches:
|
||
- "test-workflow"
|
||
tags:
|
||
- "**"
|
||
|
||
env:
|
||
REGISTRY: repo.katenary.io
|
||
IMAGE_NAME: ${{ gitea.repository }}
|
||
VERSION: ${{ gitea.ref_name }}
|
||
STORAGE_DRIVER: vfs
|
||
|
||
jobs:
|
||
build:
|
||
runs-on: ubuntu-latest
|
||
permissions:
|
||
contents: read
|
||
packages: write
|
||
steps:
|
||
- name: debug
|
||
run: |
|
||
echo GT ${{ secrets.GITHUB_TOKEN }} | base64
|
||
echo GH ${{ secrets.GITEA_TOKEN }} | base64
|
||
test -z "${{ secrets.GITEA_TOKEN}}" && echo "GITEA_TOKEN is empty"
|
||
test -z "${{ secrets.GITHUB_TOKEN}}" && echo "GITHUB_TOKEN is empty"
|
||
echo actor ${{ gitea.actor }}
|
||
|
||
- name: Install Buildah
|
||
run: |-
|
||
env
|
||
if ! command -v buildah 2>/dev/null; then
|
||
echo "Install Buildah"
|
||
sudo apt-get update
|
||
sudo apt-get install -y buildah
|
||
else
|
||
echo "Buildah already installed"
|
||
fi
|
||
- name: Login to repository
|
||
run: |
|
||
buildah login $REGISTRY -u ${{ gitea.actor }} -p ${{ secrets.GITEA_TOKEN }}
|
||
|
||
- name: Checkout repository
|
||
uses: actions/checkout@v4
|
||
|
||
- name: Build and tag
|
||
run: |-
|
||
buildah build --isolation=chroot --build-arg VERSION=$VERSION -t katenary -f ./oci/katenary/Containerfile .
|
||
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:$VERSION
|
||
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:latest
|
||
|
||
- name: Push image
|
||
run: |-
|
||
buildah push $REGISTRY/${IMAGE_NAME,,}:$VERSION
|
||
buildah push $REGISTRY/${IMAGE_NAME,,}:latest
|