Skip to content

Commit 554b737

Browse files
committed
Build docker image in release
1 parent 12df601 commit 554b737

2 files changed

Lines changed: 42 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,12 @@ jobs:
5151
working-directory: frontend
5252
run: npm ci
5353

54-
- name: Env
55-
working-directory: frontend
56-
run: echo "VITE_BASE_PATH=/OpenNumismatWeb/dev/" > .env.local
57-
5854
- name: Build
5955
working-directory: frontend
60-
run: npm run build
61-
62-
- name: Clear env
63-
working-directory: frontend
64-
run: rm .env.local
56+
run: |
57+
echo "VITE_BASE_PATH=/OpenNumismatWeb/dev/" > .env.local
58+
npm run build
59+
rm .env.local
6560
6661
- name: Deploy to GitHub Pages
6762
uses: peaceiris/actions-gh-pages@v3

.github/workflows/release.yml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ jobs:
4141
working-directory: frontend
4242
run: npm ci
4343

44-
- name: Env
45-
working-directory: frontend
46-
run: echo "VITE_BASE_PATH=/OpenNumismatWeb/" > .env.local
47-
4844
- name: Build
4945
working-directory: frontend
50-
run: npm run build
46+
run: |
47+
echo "VITE_BASE_PATH=/OpenNumismatWeb/" > .env.local
48+
npm run build
49+
rm .env.local
5150
5251
- name: Deploy to GitHub Pages
5352
uses: peaceiris/actions-gh-pages@v3
@@ -60,3 +59,37 @@ jobs:
6059
with:
6160
tag_name: v${{ steps.bump.outputs.current-version }}
6261
draft: true
62+
63+
- name: Set up QEMU
64+
uses: docker/setup-qemu-action@v3
65+
66+
- name: Set up Docker Buildx
67+
uses: docker/setup-buildx-action@v3
68+
69+
- name: Login to ${{ env.REGISTRY }} registry
70+
uses: docker/login-action@v3
71+
with:
72+
registry: ${{ env.REGISTRY }}
73+
username: ${{ env.REGISTRY_USER }}
74+
password: ${{ env.REGISTRY_PASS }}
75+
76+
- name: Extract metadata (tags, labels) for Docker
77+
id: meta
78+
uses: docker/metadata-action@v5
79+
with:
80+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
81+
tags: |
82+
type=ref,event=branch
83+
type=ref,event=pr
84+
type=semver,pattern={{version}}
85+
#type=semver,pattern={{major}}.{{minor}}
86+
#type=semver,pattern={{major}}
87+
88+
- name: Build and push
89+
uses: docker/build-push-action@v6
90+
with:
91+
context: .
92+
push: true
93+
platforms: linux/amd64,linux/arm64
94+
tags: ${{ steps.meta.outputs.tags }}
95+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)