Skip to content
This repository was archived by the owner on Aug 14, 2026. It is now read-only.

Commit b92ab34

Browse files
committed
Require UI tests before Docker publish
1 parent 424cab4 commit b92ab34

2 files changed

Lines changed: 41 additions & 50 deletions

File tree

‎.github/workflows/docker-publish.yml‎

Lines changed: 0 additions & 50 deletions
This file was deleted.

‎.github/workflows/test.yml‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Tests
33
on:
44
push:
55
branches: [ main, master ]
6+
tags: [ 'v*' ]
67
pull_request:
78
branches: [ main, master ]
89

@@ -75,3 +76,43 @@ jobs:
7576
name: playwright-traces
7677
path: test-results/
7778
retention-days: 7
79+
80+
docker-publish:
81+
runs-on: ubuntu-latest
82+
needs: ui-tests
83+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
84+
85+
steps:
86+
- name: Checkout repository
87+
uses: actions/checkout@v4
88+
89+
- name: Set up Docker Buildx
90+
uses: docker/setup-buildx-action@v3
91+
92+
- name: Log in to Docker Hub
93+
uses: docker/login-action@v3
94+
with:
95+
username: ${{ secrets.DOCKERHUB_USERNAME }}
96+
password: ${{ secrets.DOCKERHUB_TOKEN }}
97+
98+
- name: Extract metadata (tags, labels)
99+
id: meta
100+
uses: docker/metadata-action@v5
101+
with:
102+
images: loganhan123/deye-force-discharger
103+
tags: |
104+
type=ref,event=branch
105+
type=semver,pattern={{version}}
106+
type=semver,pattern={{major}}.{{minor}}
107+
type=raw,value=latest,enable={{is_default_branch}}
108+
109+
- name: Build and push Docker image
110+
uses: docker/build-push-action@v5
111+
with:
112+
context: .
113+
push: true
114+
tags: ${{ steps.meta.outputs.tags }}
115+
labels: ${{ steps.meta.outputs.labels }}
116+
cache-from: type=gha
117+
cache-to: type=gha,mode=max
118+
platforms: linux/amd64,linux/arm64

0 commit comments

Comments
 (0)