Skip to content

Commit 8dfa1ec

Browse files
feat: modify release action
1 parent 5933a55 commit 8dfa1ec

File tree

3 files changed

+38
-82
lines changed

3 files changed

+38
-82
lines changed

.github/workflows/dev-workflow.yml

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

.github/workflows/release-workflow.yml

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

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Build Image
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
8+
env:
9+
DOCKERHUB_REPO: 1panel/kubepi
10+
11+
jobs:
12+
docker:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
- name: Get Version
18+
id: get_version
19+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
20+
- name: Set up QEMU
21+
uses: docker/setup-qemu-action@v2
22+
- name: Set up Docker Buildx
23+
uses: docker/setup-buildx-action@v2
24+
- name: Login to Docker Hub
25+
uses: docker/login-action@v2
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
29+
- name: Build and Push
30+
uses: docker/build-push-action@v3
31+
with:
32+
context: .
33+
file: ./Dockerfile
34+
platforms: linux/amd64,linux/arm64
35+
push: true
36+
tags: |
37+
${{ env.DOCKERHUB_REPO }}:latest
38+
${{ env.DOCKERHUB_REPO }}:${{ steps.get_version.outputs.VERSION }}

0 commit comments

Comments
 (0)