Add .forgejo/workflows/build.yml
This commit is contained in:
parent
e64c5272cc
commit
39048e99c4
1 changed files with 45 additions and 0 deletions
45
.forgejo/workflows/build.yml
Normal file
45
.forgejo/workflows/build.yml
Normal file
|
@ -0,0 +1,45 @@
|
|||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
extract-version:
|
||||
runs-on: node
|
||||
outputs:
|
||||
version: ${{ steps.get-version.outputs.version }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Read version from Dockerfile
|
||||
id: get-version
|
||||
run: |
|
||||
version=$(grep '^ARG VERSION=' Dockerfile | cut -d '=' -f2)
|
||||
echo "Extracted version: $version"
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
|
||||
docker:
|
||||
runs-on: host
|
||||
needs:
|
||||
- extract-version
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.h2-invent.com
|
||||
username: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_USER }}
|
||||
password: ${{ secrets.FORGEJO_ACTION_PACKAGE_RW_KEY }}
|
||||
|
||||
- name: Build and push Keycloak Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
tags: git.h2-invent.com/public-system-design/whitebophir:${{ needs.extract-version.outputs.version }}
|
||||
build-args: VERSION=${{ needs.extract-version.outputs.version }}
|
||||
|
Loading…
Add table
Reference in a new issue