mirror of
https://git.asonix.dog/asonix/pict-rs
synced 2024-12-22 03:11:24 +00:00
Downgrade artifact actions, add dockerfile
This commit is contained in:
parent
7afc38527b
commit
94c307c869
2 changed files with 44 additions and 39 deletions
|
@ -45,13 +45,17 @@ jobs:
|
|||
- tests
|
||||
strategy:
|
||||
matrix:
|
||||
fail-fast: false
|
||||
include:
|
||||
- target: x86_64-unknown-linux-musl
|
||||
artifact: linux-amd64
|
||||
artifact: amd64
|
||||
platform: linux/amd64
|
||||
- target: armv7-unknown-linux-musleabihf
|
||||
artifact: linux-arm32v7
|
||||
artifact: arm32v7
|
||||
platform: linux/arm/v7
|
||||
- target: aarch64-unknown-linux-musl
|
||||
artifact: linux-arm64v8
|
||||
artifact: arm64v8
|
||||
platform: linux/arm64
|
||||
runs-on: docker
|
||||
container:
|
||||
image: docker.io/node:20-bookworm
|
||||
|
@ -76,56 +80,33 @@ jobs:
|
|||
mkdir artifacts
|
||||
cp target/${{ matrix.target }}/release/pict-rs artifacts/pict-rs
|
||||
-
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{ matrix.artifact }}
|
||||
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: |
|
||||
platform=${{ matrix.platform }}
|
||||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV
|
||||
-
|
||||
name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
uses: https://github.com/docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY_IMAGE }}
|
||||
-
|
||||
name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
uses: https://github.com/docker/setup-qemu-action@v3
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
uses: https://github.com/docker/setup-buildx-action@v3
|
||||
-
|
||||
name: Docker login
|
||||
uses: docker/login-action@v3
|
||||
uses: https://github.com/docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
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
|
||||
uses: docker/build-push-action@v5
|
||||
|
@ -142,7 +123,7 @@ jobs:
|
|||
touch "/tmp/digests/${digest#sha256:}"
|
||||
-
|
||||
name: Upload ${{ matrix.platform }} digest
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: digests
|
||||
path: /tmp/digests/*
|
||||
|
@ -153,11 +134,11 @@ jobs:
|
|||
runs-on: docker
|
||||
container:
|
||||
image: docker.io/node:20-bookworm
|
||||
needs: [prepare-docker]
|
||||
needs: [build]
|
||||
steps:
|
||||
-
|
||||
name: Download digests
|
||||
uses: actions/download-artifact@v4
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: digests
|
||||
path: /tmp/digests
|
||||
|
@ -193,19 +174,19 @@ jobs:
|
|||
run: |
|
||||
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}
|
||||
|
||||
upload-release:
|
||||
publish-forgejo:
|
||||
needs: [build]
|
||||
runs-on: docker
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: arm64v8
|
||||
path: artifacts/
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: arm32v7
|
||||
path: artifacts/
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: arm64v8
|
||||
path: artifacts/
|
||||
|
|
24
docker/forgejo/Dockerfile
Normal file
24
docker/forgejo/Dockerfile
Normal 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"]
|
Loading…
Reference in a new issue