PAKET (#4)
All checks were successful
Deploy Container Image to Registry / build-image (push) Successful in 46s
All checks were successful
Deploy Container Image to Registry / build-image (push) Successful in 46s
Co-authored-by: Patrick Niebeling <patrick.niebeling@adacor.com> Reviewed-on: #4
This commit is contained in:
31
.gitea/workflows/deploy.yaml
Normal file
31
.gitea/workflows/deploy.yaml
Normal file
@ -0,0 +1,31 @@
|
||||
name: Deploy Container Image to Registry
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-image:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Image
|
||||
run: |
|
||||
echo "[***] Build hook running"
|
||||
cd ${{ gitea.workspace }}/StableV2/
|
||||
VERSION=$(git ls-remote --tags -q https://github.com/rspamd/rspamd | sed -n "s/^[[:xdigit:]]\{40\}[[:blank:]]refs\/tags\/\([0-9]\{1\}\.[0-9]\{1,2\}\($\|\.[0-9]\{1,2\}$\)\)/\1/p" | sort --version-sort | tail -1)
|
||||
|
||||
docker build \
|
||||
--build-arg VERSION=${VERSION} \
|
||||
--build-arg COMMIT=$(git ls-remote --tags -q https://github.com/rspamd/rspamd | sed -n "s/^\([[:xdigit:]]\{40\}\)[[:blank:]]refs\/tags\/${VERSION}^{}$/\1/p" | xargs git rev-parse --short) \
|
||||
--build-arg BRANCH=$(git rev-parse --abbrev-ref HEAD) \
|
||||
--build-arg DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
||||
-t ${{ vars.DOCKER_REPO }}/gnilebein/${{ vars.IMAGE_NAME }} -t ${{ vars.DOCKER_REPO }}/gnilebein/${{ vars.IMAGE_NAME }}:$VERSION .
|
||||
- name: Push Image
|
||||
run: |
|
||||
echo '${{ vars.DOCKER_AUTH_CONFIG }}' > ~/.docker/config.json
|
||||
cat ~/.docker/config.json
|
||||
VERSION=$(git ls-remote --tags -q https://github.com/rspamd/rspamd | sed -n "s/^[[:xdigit:]]\{40\}[[:blank:]]refs\/tags\/\([0-9]\{1\}\.[0-9]\{1,2\}\($\|\.[0-9]\{1,2\}$\)\)/\1/p" | sort --version-sort | tail -1)
|
||||
docker push ${{ vars.DOCKER_REPO }}/gnilebein/${{ vars.IMAGE_NAME }}
|
||||
docker push ${{ vars.DOCKER_REPO }}/gnilebein/${{ vars.IMAGE_NAME }}:${VERSION}
|
Reference in New Issue
Block a user