More fixes
All checks were successful
docker

This commit is contained in:
ItzYanick 2023-03-24 13:34:44 +01:00
parent ec6a9f9440
commit 671b4be8fb
No known key found for this signature in database
GPG key ID: 0E3DB1F28A357B8A
2 changed files with 23 additions and 16 deletions

View file

@ -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 .

View file

@ -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