-
Notifications
You must be signed in to change notification settings - Fork 76
55 lines (48 loc) · 1.55 KB
/
docker-web.yml
File metadata and controls
55 lines (48 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Build Web
on:
push:
branches: [main]
tags:
- "web-v*"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version from tag
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/web-v* ]]; then
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#web-v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "is_release=true" >> $GITHUB_OUTPUT
else
echo "version=${{ github.sha }}" >> $GITHUB_OUTPUT
echo "is_release=false" >> $GITHUB_OUTPUT
fi
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}/web
tags: |
type=raw,value=${{ steps.version.outputs.version }}
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' || steps.version.outputs.is_release == 'true' }}
- uses: docker/build-push-action@v6
with:
context: .
file: apps/web/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VITE_SERVER_URL=${{ vars.VITE_SERVER_URL || 'https://api.ocrbase.dev' }}