feat: dev docker

This commit is contained in:
naiba
2024-10-24 21:33:36 +08:00
parent 31520debb2
commit 5cf8b8024c
4 changed files with 53 additions and 7 deletions

View File

@@ -4,6 +4,8 @@ on:
push:
tags:
- "v*"
branches:
- dev
jobs:
build:
@@ -33,7 +35,7 @@ jobs:
- uses: actions/checkout@v4
- name: Fetch IPInfo GeoIP Database
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
if: github.event_name == 'push'
env:
IPINFO_TOKEN: ${{ secrets.IPINFO_TOKEN }}
run: |
@@ -81,6 +83,7 @@ jobs:
done
- name: Release
if: contains(github.ref, 'refs/tags/')
uses: ncipollo/release-action@v1
with:
artifacts: "assets/*/*/*.zip"
@@ -99,6 +102,7 @@ jobs:
curl -s https://purge.jsdelivr.net/gh/$LOWER_USERNAME/nezha@master/script/config.yaml
- name: Trigger sync
if: contains(github.ref, 'refs/tags/')
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
@@ -108,7 +112,7 @@ jobs:
release-docker:
runs-on: ubuntu-latest
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
if: github.event_name == 'push'
needs: build
name: Release Docker images
steps:
@@ -124,12 +128,26 @@ jobs:
chmod -R +x ./assets/*
mkdir dist
mv ./assets/*/*/* ./dist
- name: prepare frontend dists
run: |
wget https://github.com/nezhahq/nezha-dashboard/releases/download/v0.0.2/dist.zip
unzip dist.zip
mv dist admin-dist
- name: Extract branch name
- name: Extract branch name in tag
if: contains(github.ref, 'refs/tags/')
run: |
export TAG_NAME=$(echo ${GITHUB_REF#refs/tags/})
echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT
id: extract_branch
- name: Extract branch name in branch
if: not(contains(github.ref, 'refs/tags/'))
run: |
export TAG_NAME=$(echo ${GITHUB_REF#refs/heads/})
echo "tag=$TAG_NAME" >> $GITHUB_OUTPUT
id: extract_branch
- name: Log into GHCR
uses: docker/login-action@master