Add .gitea/workflows/build.yml

This commit is contained in:
Jamie Schouten 2024-09-13 20:02:49 +00:00
commit da61ec667a

View File

@ -0,0 +1,40 @@
name: build
on:
workflow_call:
inputs:
tag:
required: false
type: string
default: latest
secrets:
username:
required: false
type: string
default: ${{ secrets.REGISTRY_USERNAME }}
password:
required: false
type: string
default: ${{ secrets.REGISTRY_PASSWORD }}
jobs:
build:
runs-on: ubuntu-24.04
container:
image: git.qlic.nl/qlic/builder:latest
credentials:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: git.qlic.nl
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build
run: docker build . -t ${{ vars.REGISTRY }}/${{ gitea.repository }}:${{ inputs.tag }} -t ${{ vars.REGISTRY }}/${{ gitea.repository }}:${{ gitea.sha }}
- name: Push
run: docker push ${{ vars.REGISTRY }}/${{ gitea.repository }} --all-tags