parent
ec6a9f9440
commit
671b4be8fb
2 changed files with 23 additions and 16 deletions
|
|
@ -12,18 +12,25 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Login to Docker Registry
|
- name: Set up Docker Buildx
|
||||||
uses: https://github.com/docker/login-action@v2
|
uses: https://github.com/docker/setup-buildx-action@v2
|
||||||
with:
|
- name: Log-in to Registry
|
||||||
registry: git.itzyanick.de
|
run: echo "${{ secrets.PACKAGE_TOKEN }}" | docker login https://git.itzyanick.de -u ${{ github.actor }} --password-stdin
|
||||||
username: ItzYanick
|
- name: Build and push container image
|
||||||
password: ${{ secrets.PACKAGE_TOKEN }}
|
run: |
|
||||||
- name: Build and push
|
IMAGE_ID=$(echo git.itzyanick.de/${{ github.repository }} | tr '[A-Z]' '[a-z]')
|
||||||
uses: https://github.com/docker/build-push-action@v4
|
# Strip git ref prefix from version
|
||||||
with:
|
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
||||||
context: .
|
# Strip "v" prefix from tag name
|
||||||
file: ./Dockerfile
|
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||||
push: true
|
# when the branch is master, replace master with latest
|
||||||
tags: git.itzyanick.de/itzyanick/runner-docker:latest
|
[ "$VERSION" == "master" ] && VERSION=latest
|
||||||
build-args: |
|
CHECKOUT=$(echo "${{ github.ref }}" | sed 's|-.*||')
|
||||||
CHECKOUT=${{ github.ref }}
|
echo IMAGE_ID=$IMAGE_ID
|
||||||
|
echo VERSION=$VERSION
|
||||||
|
echo CHECKOUT=$CHECKOUT
|
||||||
|
# Build and Publish container image
|
||||||
|
docker buildx build --push \
|
||||||
|
--tag $IMAGE_ID:$VERSION \
|
||||||
|
--build-arg CHECKOUT=$CHECKOUT \
|
||||||
|
--platform linux/amd64 .
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ RUN apk fix && \
|
||||||
apk --no-cache --update add git make
|
apk --no-cache --update add git make
|
||||||
|
|
||||||
RUN mkdir /build
|
RUN mkdir /build
|
||||||
RUN git clone https://git.itzyanick.de/ItzYanick/runner-docker.git /build/runner \
|
RUN git clone https://code.forgejo.org/forgejo/runner.git /build/runner \
|
||||||
&& cd /build/runner \
|
&& cd /build/runner \
|
||||||
&& git checkout $CHECKOUT
|
&& git checkout $CHECKOUT
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue