builder/.forgejo/workflows/build.yaml

34 lines
1.1 KiB
YAML
Raw Normal View History

2024-07-15 22:05:19 +02:00
on: [push]
env:
2025-05-16 17:42:27 +02:00
REGISTRY: forge.hornwitser.no
2025-05-16 17:50:14 +02:00
REGISTRY_IMAGE: forge.hornwitser.no/furnavia/builder:${{ github.ref_name }}
2024-07-15 22:05:19 +02:00
jobs:
build:
2025-05-16 17:42:27 +02:00
runs-on: alpine
2024-07-15 22:05:19 +02:00
steps:
-
2025-05-16 18:53:29 +02:00
name: Install dependencies
2025-05-16 17:51:24 +02:00
shell: sh
run: |
2025-05-16 19:17:06 +02:00
apk add bash buildah git
2024-07-15 22:05:19 +02:00
-
2025-05-16 18:53:29 +02:00
name: Checkout repository
2025-05-16 17:51:24 +02:00
shell: sh
2025-05-16 18:53:29 +02:00
run: |
2025-05-16 19:08:29 +02:00
git config --global credential.helper store
echo "https://runner:${{ secrets.GITHUB_TOKEN }}@$(echo "${{ github.server_url }}" | cut -b 9-)" > ~/.git-credentials
2025-05-16 18:53:29 +02:00
git clone --branch ${{ github.ref_name }} ${{ github.server_url }}/${{ github.repository }} ${{ github.workspace }}
2025-05-16 17:42:27 +02:00
-
name: Authenticate with registry
2025-05-16 17:51:24 +02:00
shell: sh
2025-05-16 17:42:27 +02:00
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | buildah login ${{ env.REGISTRY }} --username runner --password-stdin
2024-07-15 22:05:19 +02:00
-
2025-05-16 17:50:14 +02:00
name: Build and push
2025-05-16 17:51:24 +02:00
shell: sh
2025-05-16 17:50:14 +02:00
run: |
id
2025-05-16 18:53:29 +02:00
${{ github.workspace }}/builder.sh ${{ env.REGISTRY_IMAGE }}
2025-05-16 17:50:14 +02:00
buildah push ${{ env.REGISTRY_IMAGE }}