builder/.forgejo/workflows/build.yaml

42 lines
1.2 KiB
YAML
Raw Normal View History

2024-07-15 22:05:19 +02:00
on: [push]
env:
2024-07-15 23:20:33 +02:00
REGISTRY: forgejo.sbox.hornwitser.no
2024-07-15 23:24:27 +02:00
REGISTRY_IMAGE: forgejo.sbox.hornwitser.no/furnavia/builder
2024-07-15 22:05:19 +02:00
jobs:
build:
runs-on: docker
2024-07-15 22:08:06 +02:00
container:
image: sif.g100.hornwitser.no:3000/furnavia/builder:latest
2024-07-15 22:05:19 +02:00
steps:
2024-07-20 18:53:37 +02:00
-
name: Get image tags
id: info
shell: bash
run: |
tee -a ${GITHUB_OUTPUT} <<EOF
TAGS<<EOT
$(
echo ${{ env.REGISTRY_IMAGE }}:${{ github.ref_name }}
if [[ "${{ github.ref_name }}" =~ ^r[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ${{ env.REGISTRY_IMAGE }}:latest
elif [[ "${{ github.ref_name }}" == forgejo ]]; then
echo ${{ env.REGISTRY_IMAGE }}:development
fi
)
EOT
EOF
2024-07-15 22:05:19 +02:00
-
name: Authenticate
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
registry: ${{ env.REGISTRY }}
-
name: Build and push
uses: docker/build-push-action@v6
with:
push: true
2024-07-20 18:53:37 +02:00
tags: ${{ steps.info.outputs.TAGS }}