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:
|
2024-08-02 13:14:43 +02:00
|
|
|
-
|
2025-05-16 18:53:29 +02:00
|
|
|
name: Install dependencies
|
2025-05-16 17:51:24 +02:00
|
|
|
shell: sh
|
2024-08-02 13:14:43 +02:00
|
|
|
run: |
|
2025-05-16 17:53:20 +02:00
|
|
|
apk add 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
|
2025-05-16 19:09:25 +02:00
|
|
|
echo "https://github:${{ 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 "${{ secrets.REGISTRY_USERNAME }}" --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 }}
|