Skip to content

Commit 6841d1d

Browse files
authored
add manual docker build (#60)
1 parent 04d12d9 commit 6841d1d

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

Diff for: .github/workflows/docker-build-push-on-draft.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Docker Image Build on manual trigger
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
env:
9+
ORG: opentelekomcloud
10+
PROJECT: status-dashboard-v3-api
11+
12+
jobs:
13+
push_if_tag:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Docker meta
20+
id: meta
21+
uses: docker/metadata-action@v5
22+
with:
23+
images: |
24+
"${{ secrets.REGISTRY }}/${{ env.ORG }}/${{ env.PROJECT }}"
25+
tags: |
26+
type=schedule
27+
type=ref,event=branch
28+
type=ref,event=pr
29+
type=semver,pattern={{version}}
30+
type=semver,pattern={{major}}.{{minor}}
31+
type=semver,pattern={{major}}
32+
type=sha
33+
34+
- name: Set up Docker Buildx
35+
uses: docker/setup-buildx-action@v3
36+
37+
- name: Login to Container Registry
38+
uses: docker/login-action@v3
39+
with:
40+
registry: ${{ secrets.REGISTRY }}
41+
username: ${{ secrets.REGISTRY_USER }}
42+
password: ${{ secrets.REGISTRY_PASSWORD }}
43+
44+
- name: Build and push
45+
uses: docker/build-push-action@v6
46+
with:
47+
context: .
48+
tags: ${{ steps.meta.outputs.tags }}
49+
labels: ${{ steps.meta.outputs.labels }}
50+
push: true
51+
build-args: |
52+
BASE_URL=${{ secrets.BASE_URL }}
53+
AUTH_TOKEN=${{ secrets.AUTH_TOKEN }}

0 commit comments

Comments
 (0)