mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-23 13:18:13 -05:00
44 lines
1.7 KiB
YAML
44 lines
1.7 KiB
YAML
name: Dashboard image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
paths-ignore:
|
|
- "cmd/playground/**"
|
|
- "cmd/agent/**"
|
|
- "script/**"
|
|
- "*.md"
|
|
- ".*"
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
|
|
- name: Log into registry
|
|
run: |
|
|
echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
|
|
echo "${{ secrets.ALI_PAT }}" | docker login registry.cn-shanghai.aliyuncs.com -u ${{ secrets.ALI_USER }} --password-stdin
|
|
|
|
- name: Build dasbboard image
|
|
run: |
|
|
go env
|
|
go test -v ./...
|
|
docker build -t nezha-dasbboard -f Dockerfile .
|
|
- name: Push dasbboard image
|
|
run: |
|
|
GHRC_IMAGE_NAME=$(echo "ghcr.io/${{ github.repository_owner }}/nezha-dashboard" | tr '[:upper:]' '[:lower:]')
|
|
ALI_IMAGE_NAME=$(echo "registry.cn-shanghai.aliyuncs.com/${{ github.repository_owner }}/nezha-dashboard" | tr '[:upper:]' '[:lower:]')
|
|
docker tag nezha-dasbboard $GHRC_IMAGE_NAME
|
|
docker tag nezha-dasbboard $ALI_IMAGE_NAME
|
|
docker push $GHRC_IMAGE_NAME
|
|
docker push $ALI_IMAGE_NAME
|
|
- name: Purge jsdelivr cache
|
|
run: |
|
|
curl https://purge.jsdelivr.net/gh/${{ github.repository_owner }}/nezha@master/script/install.sh
|
|
curl https://purge.jsdelivr.net/gh/${{ github.repository_owner }}/nezha@master/script/nezha-agent.service
|
|
curl https://purge.jsdelivr.net/gh/${{ github.repository_owner }}/nezha@master/script/docker-compose.yaml
|
|
curl https://purge.jsdelivr.net/gh/${{ github.repository_owner }}/nezha@master/script/config.yaml
|