0
0

Revert to offical Photon image

This commit is contained in:
Opnxng 2023-11-16 00:16:21 +08:00
parent 2c22554b5e
commit dc38d2a8d2
2 changed files with 3 additions and 76 deletions

View File

@ -1,73 +0,0 @@
name: photon
run-name: photon
env:
REPO_NAME: photon
REMOTE_REPO: https://github.com/Xyphyn/photon.git
BUILD_PLATFORM: linux/arm64
on:
schedule:
- cron: "0 0 * * *" # at midnight
push:
paths:
- ".gitea/workflows/photon.yaml"
jobs:
build:
runs-on: runner
container:
image: docker:cli
steps:
- name: Install packages
run: apk --no-cache add curl git jq
- name: Check latest upstream commit
run: |
STORED_COMMIT=$(curl -H "Authorization: Bearer ${{ secrets.NT }}" -s "https://nt.opnxng.com/${REPO_NAME}/raw?poll=1" | tail -n 1)
LATEST_COMMIT=$(git ls-remote ${REMOTE_REPO} | awk '{print $1}' | head -1)
echo "STORED_COMMIT=${STORED_COMMIT}" >> "$GITHUB_ENV"
echo "LATEST_COMMIT=${LATEST_COMMIT}" >> "$GITHUB_ENV"
echo "Stored Commit: ${STORED_COMMIT}"
echo "Latest Commit: ${LATEST_COMMIT}"
- name: Build and push Docker image
run: |
if [ "$STORED_COMMIT" != "$LATEST_COMMIT" ]; then
echo "Found a new commit, building new image"
# Install Docker Buildx
BUILDX_VERSION=$(wget -q -O- https://api.github.com/repos/docker/buildx/releases/latest | jq -r '.name')
wget -O /usr/bin/docker-buildx https://github.com/docker/buildx/releases/download/$BUILDX_VERSION/buildx-$BUILDX_VERSION.linux-arm64
chmod +x /usr/bin/docker-buildx
# Create and use Docker Buildx builder
docker-buildx create --use --name buildx
# Login to Package Registry
echo "${{ secrets.TOKEN }}" | docker login git.opnxng.com -u ${{ gitea.repository_owner }} --password-stdin
# Build and push Docker image
mkdir temp
cd temp
git clone ${REMOTE_REPO} .
sed -i 's/FROM node:20/FROM node:slim/' Dockerfile # use node:slim
docker-buildx build \
--platform ${BUILD_PLATFORM} \
-t git.opnxng.com/${{ gitea.repository_owner }}/${REPO_NAME}:latest \
-f ./Dockerfile \
--push . && \
curl -H prio:low -d "Built and pushed ${REPO_NAME}" https://ntfy.opnxng.com/build || \
{ curl -H tags:warning -H prio:high -d "Built and pushed ${REPO_NAME} failed!" https://ntfy.opnxng.com/build ; exit 1; }
# Remove Docker Buildx builder
docker-buildx rm buildx
else
echo "No new commit, skipped build"
fi
- name: Update stored commit
run: |
if [ "$STORED_COMMIT" != "$LATEST_COMMIT" ]; then
curl -H "Authorization: Bearer ${{ secrets.NT }}" -d $(git ls-remote ${REMOTE_REPO} | awk '{print $1}' | head -1) "https://nt.opnxng.com/${REPO_NAME}"
STORED_COMMIT=$(curl -H "Authorization: Bearer ${{ secrets.NT }}" -s "https://nt.opnxng.com/${REPO_NAME}/raw?poll=1" | tail -n 1)
echo "STORED_COMMIT=${STORED_COMMIT}" >> "$GITHUB_ENV"
else
curl -H "Authorization: Bearer ${{ secrets.NT }}" -d $(git ls-remote ${REMOTE_REPO} | awk '{print $1}' | head -1) "https://nt.opnxng.com/${REPO_NAME}"
STORED_COMMIT=$(curl -H "Authorization: Bearer ${{ secrets.NT }}" -s "https://nt.opnxng.com/${REPO_NAME}/raw?poll=1" | tail -n 1)
echo "STORED_COMMIT=${STORED_COMMIT}" >> "$GITHUB_ENV"
exit 1
fi

View File

@ -1,10 +1,10 @@
# Docker images used on Opnxng
If there's no suitable upstream image, we build and host one on this repo. Most images are built for our ARM64 servers. But others are free to use them.
If there's no suitable upstream image, we build and host one on this repo. Most images are built for our ARM64 servers. But others are free to use them.
We use a custom SearXNG container with a changed theme based on [the paulgo fork](https://paulgo.dev/infra/paulgoio/searxng).
Thanks to [mrpaulblack](https://paulgo.dev/infra/paulgoio), [aryak](https://aryak.me/),
Thanks to [mrpaulblack](https://paulgo.dev/infra/paulgoio), [aryak](https://aryak.me/),
[Xavi](https://gitlab.com/xavion-lux), [TheFrenchGhosty](https://github.com/PussTheCat-org), and other developers.
Contact us via [email](mailto:opnxng@tuta.io).
@ -26,7 +26,6 @@ Source | Image
[ThePenguinDev/proxigram](https://codeberg.org/ThePenguinDev/proxigram) | opnxng/proxigram
[Bing Chilling/Rat Aint Tieba](https://0xacab.org/johnxina/rat) | opnxng/rat-aint-tieba
[ansible/ansible](https://github.com/ansible/ansible) | opnxng/ansible
[Xyphyn/photon](https://github.com/Xyphyn/photon) | opnxng/photon [(temporary)](https://github.com/Xyphyn/photon/issues/180)
[zyachel/quetre](https://github.com/zyachel/quetre) | [pussthecatorg/quetre](https://quay.io/repository/pussthecatorg/quetre?tab=tags&tag=latest)
[zyachel/libremdb](https://github.com/zyachel/libremdb) | [pussthecatorg/libremdb](https://quay.io/repository/pussthecatorg/libremdb?tab=tags&tag=latest)
[cadence/breezewiki](https://gitdab.com/cadence/breezewiki) | [pussthecatorg/breezewiki](https://quay.io/repository/pussthecatorg/breezewiki?tab=tags&tag=latest)
@ -42,6 +41,7 @@ Source | Image
[libreddit/libreddit](https://github.com/libreddit/libreddit) | libreddit/libreddit
[aeharding/voyager](https://github.com/aeharding/voyager) | aeharding/voyager
[rystaf/mlmym](https://github.com/rystaf/mlmym) | rystaf/mlmym
[Xyphyn/photon](https://github.com/Xyphyn/photon) | Xyphyn/photon
[Ahwxorg/Binternet](https://github.com/Ahwxorg/binternet/) | ahwxorg/binternet
[gothub/gothub](https://codeberg.org/gothub/gothub) | gothub/gothub
[go-gitea/gitea](https://github.com/go-gitea/gitea) | gitea/gitea (with [Rainnny7/gitea-github-theme](https://github.com/Rainnny7/gitea-github-theme))