-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
16 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ name: "Build and push images" | |
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 16 * * * | ||
|
||
jobs: | ||
Building: | ||
|
@@ -20,33 +18,19 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check the latest verion | ||
run: | | ||
[ -e README_EN.md ] && NOW=$(awk '/^The latest version/{print $NF}' README_EN.md) | ||
LATEST=$(wget -qO- "https://api.github.com/repos/naiba/nezha/releases/latest" | awk -F '"' '/"tag_name"/{print $4}') | ||
if [ "$NOW" != "$LATEST" ]; then | ||
sed -i "s/\(^The latest version:[ ]\+\)v.*/\1$LATEST/" README_EN.md | ||
sed -i "s/\(^当前镜像版本:[ ]\+\)v.*/\1$LATEST/" README.md | ||
echo "VERSION=$LATEST" >> $GITHUB_ENV | ||
fi | ||
- name: Set up QEMU | ||
if: ${{ env.VERSION != '' || github.event_name == 'workflow_dispatch' }} | ||
uses: docker/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
if: ${{ env.VERSION != '' || github.event_name == 'workflow_dispatch' }} | ||
uses: docker/[email protected] | ||
|
||
- name: Login to DockerHub | ||
if: ${{ env.VERSION != '' || github.event_name == 'workflow_dispatch' }} | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ env.DOCKER_USERNAME }} | ||
password: ${{ env.DOCKER_PASSWORD }} | ||
|
||
- name: Push images to Docker hub | ||
if: ${{ env.VERSION != '' || github.event_name == 'workflow_dispatch' }} | ||
uses: docker/[email protected] | ||
with: | ||
push: true | ||
|
@@ -55,6 +39,5 @@ jobs: | |
|
||
- name: Upload to repository | ||
uses: stefanzweifel/[email protected] | ||
if: ${{ env.VERSION != '' || github.event_name == 'workflow_dispatch' }} | ||
with: | ||
commit_message: Push images ${{ env.VERSION }} by Github Actions, ${{ env.DATE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
FROM ghcr.io/naiba/nezha-dashboard | ||
|
||
EXPOSE 80 | ||
FROM debian | ||
|
||
WORKDIR /dashboard | ||
|
||
COPY entrypoint.sh /dashboard/ | ||
|
||
COPY sqlite.db /dashboard/data/ | ||
|
||
RUN apt-get update &&\ | ||
apt-get -y install openssh-server wget iproute2 vim git cron unzip supervisor systemctl nginx &&\ | ||
chmod +x entrypoint.sh &&\ | ||
apt-get -y install openssh-server wget iproute2 vim git cron unzip supervisor nginx &&\ | ||
git config --global core.bigFileThreshold 1k &&\ | ||
git config --global core.compression 0 &&\ | ||
git config --global advice.detachedHead false &&\ | ||
git config --global pack.threads 1 &&\ | ||
git config --global pack.windowMemory 50m &&\ | ||
apt-get clean &&\ | ||
rm -rf /var/lib/apt/lists/* | ||
rm -rf /var/lib/apt/lists/* &&\ | ||
echo "#!/usr/bin/env bash\n\n\ | ||
bash <(wget -qO- https://raw.githubusercontent.com/fscarmen2/Argo-Nezha-Service-Container/main/init.sh)" > entrypoint.sh &&\ | ||
chmod +x entrypoint.sh | ||
|
||
ENTRYPOINT ["./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters