Compare commits

...

10 Commits

Author SHA1 Message Date
7ba5cd4e75 Extend Workflow
Some checks failed
Deploy Container Image to Registry / docker (push) Failing after 1m18s
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
2024-11-20 13:13:26 +01:00
189b83236d Finaler Task
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
2024-11-20 11:29:13 +01:00
7ec62fb748 Fix Chars
All checks were successful
Deploy Container Image to Registry / build-image (push) Successful in 43s
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
2024-11-20 10:53:09 +01:00
35a4865f43 Remove Login
Some checks failed
Deploy Container Image to Registry / build-image (push) Failing after 47s
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
2024-11-20 10:51:48 +01:00
98d44f026f Quotes
Some checks failed
Deploy Container Image to Registry / build-image (push) Failing after 46s
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
2024-11-20 10:49:36 +01:00
388bb3d683 DEBUG
Some checks failed
Deploy Container Image to Registry / build-image (push) Failing after 37s
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
2024-11-20 10:44:25 +01:00
37935dfb6d Printf
Some checks failed
Deploy Container Image to Registry / build-image (push) Failing after 36s
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
2024-11-20 10:42:40 +01:00
4799f9a8a4 Fix
Some checks failed
Deploy Container Image to Registry / build-image (push) Failing after 36s
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
2024-11-20 10:37:22 +01:00
810d59b24b Remove Cat
Some checks failed
Deploy Container Image to Registry / build-image (push) Failing after 36s
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
2024-11-20 10:36:10 +01:00
477a2f96b7 DEBUG
Some checks failed
Deploy Container Image to Registry / build-image (push) Failing after 36s
Signed-off-by: Patrick Niebeling <patrick.niebeling@adacor.com>
2024-11-20 10:09:39 +01:00
2 changed files with 52 additions and 23 deletions

View 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}

View File

@ -1,29 +1,27 @@
name: Deploy Container Image to Registry name: Deploy Container Image to Registry
run-name: Deploy to RaspberryPi on: ['push']
on: [push]
jobs: jobs:
build-image: docker:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Check out repository code - name: Set up QEMU
uses: actions/checkout@v4 uses: docker/setup-qemu-action@v3
- 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 \ - name: Set up Docker Buildx
--build-arg VERSION=${VERSION} \ uses: docker/setup-buildx-action@v3
--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) \ - name: Login to Docker Hub
--build-arg DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \ uses: docker/login-action@v3
-t ${{ vars.DOCKER_REPO }}/gnilebein/${{ vars.IMAGE_NAME }} -t ${{ vars.DOCKER_REPO }}/gnilebein/${{ vars.IMAGE_NAME }}:$VERSION . with:
- name: Push Image registry: ghcr.io
run: | username: ${{ secrets.REG_GITEA_USERNAME }}
echo "${{ secret.DOCKER_AUTH_CONFIG }}" > ~/.docker/config.json password: ${{ secrets.REG_GITEA_PASSWORD }}
docker login -i gnilebein gitea.gnilebein.de # - name: Build and push
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) # uses: docker/build-push-action@v6
docker push ${{ vars.DOCKER_REPO }}/gnilebein/${{ vars.IMAGE_NAME }} # with:
docker push ${{ vars.DOCKER_REPO }}/gnilebein/${{ vars.IMAGE_NAME }}:${VERSION}" # platforms: linux/amd64,linux/arm64
# push: true
# tags: |
# user/app:latest
# user/app:1.0.0