Downgrade artifact actions, add dockerfile

This commit is contained in:
asonix 2024-02-07 20:57:34 -06:00
parent 7afc38527b
commit 94c307c869
2 changed files with 44 additions and 39 deletions

View file

@ -45,13 +45,17 @@ jobs:
- tests - tests
strategy: strategy:
matrix: matrix:
fail-fast: false
include: include:
- target: x86_64-unknown-linux-musl - target: x86_64-unknown-linux-musl
artifact: linux-amd64 artifact: amd64
platform: linux/amd64
- target: armv7-unknown-linux-musleabihf - target: armv7-unknown-linux-musleabihf
artifact: linux-arm32v7 artifact: arm32v7
platform: linux/arm/v7
- target: aarch64-unknown-linux-musl - target: aarch64-unknown-linux-musl
artifact: linux-arm64v8 artifact: arm64v8
platform: linux/arm64
runs-on: docker runs-on: docker
container: container:
image: docker.io/node:20-bookworm image: docker.io/node:20-bookworm
@ -76,56 +80,33 @@ jobs:
mkdir artifacts mkdir artifacts
cp target/${{ matrix.target }}/release/pict-rs artifacts/pict-rs cp target/${{ matrix.target }}/release/pict-rs artifacts/pict-rs
- -
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: ${{ matrix.artifact }} name: ${{ matrix.artifact }}
path: artifacts/ path: artifacts/
prepare-docker:
needs: [build]
strategy:
matrix:
fail-fast: false
include:
- platform: linux/amd64
artifact: amd64
- platform: linux/arm/v7
artifact: arm32v7
- platform: linux/arm64
artifact: arm64v8
runs-on: docker
container:
image: docker.io/node:20-bookworm
steps:
- -
name: Prepare name: Prepare Platform
run: | run: |
platform=${{ matrix.platform }} platform=${{ matrix.platform }}
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
- -
name: Docker meta name: Docker meta
id: meta id: meta
uses: docker/metadata-action@v5 uses: https://github.com/docker/metadata-action@v5
with: with:
images: ${{ env.REGISTRY_IMAGE }} images: ${{ env.REGISTRY_IMAGE }}
- -
name: Set up QEMU name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: https://github.com/docker/setup-qemu-action@v3
- -
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: https://github.com/docker/setup-buildx-action@v3
- -
name: Docker login name: Docker login
uses: docker/login-action@v3 uses: https://github.com/docker/login-action@v3
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Download binaries
uses: actions/download-artifact@v4
with:
name: ${{ matrix.artifact }}
path: artifacts/
- -
name: Build and push ${{ matrix.platform }} docker image name: Build and push ${{ matrix.platform }} docker image
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
@ -142,7 +123,7 @@ jobs:
touch "/tmp/digests/${digest#sha256:}" touch "/tmp/digests/${digest#sha256:}"
- -
name: Upload ${{ matrix.platform }} digest name: Upload ${{ matrix.platform }} digest
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: digests name: digests
path: /tmp/digests/* path: /tmp/digests/*
@ -153,11 +134,11 @@ jobs:
runs-on: docker runs-on: docker
container: container:
image: docker.io/node:20-bookworm image: docker.io/node:20-bookworm
needs: [prepare-docker] needs: [build]
steps: steps:
- -
name: Download digests name: Download digests
uses: actions/download-artifact@v4 uses: actions/download-artifact@v3
with: with:
name: digests name: digests
path: /tmp/digests path: /tmp/digests
@ -193,19 +174,19 @@ jobs:
run: | run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
upload-release: publish-forgejo:
needs: [build] needs: [build]
runs-on: docker runs-on: docker
steps: steps:
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v3
with: with:
name: arm64v8 name: arm64v8
path: artifacts/ path: artifacts/
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v3
with: with:
name: arm32v7 name: arm32v7
path: artifacts/ path: artifacts/
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v3
with: with:
name: arm64v8 name: arm64v8
path: artifacts/ path: artifacts/

24
docker/forgejo/Dockerfile Normal file
View file

@ -0,0 +1,24 @@
FROM alpine:3.19
ARG UID=991
ARG GID=991
ENV \
UID=${UID} \
GID=${GID}
USER root
RUN \
addgroup -g "${GID}" app && \
adduser -D -G app -u "${UID}" -g "" -h /opt/app app && \
apk add exiftool ffmpeg imagemagick imagemagick-heic tini && \
chown -R app:app
COPY pict-rs /usr/local/bin/pict-rs
USER app
EXPOSE 6669
EXPOSE 8080
VOLUME /mnt
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/usr/local/bin/pict-rs", "run"]