-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (59 loc) · 2.17 KB
/
website-docker.yml
File metadata and controls
67 lines (59 loc) · 2.17 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
56
57
58
59
60
61
62
63
64
65
66
67
name: Website — Docker Hub
# Tag builds are handled by release-tauri.yml (installers + VitePress + optional Docker).
# This workflow rebuilds the image when website sources change on the default branch.
on:
push:
branches:
- main
- master
paths:
- "website/**"
- ".github/workflows/website-docker.yml"
workflow_dispatch:
env:
IMAGE_NAME: aerosol-website
jobs:
docker:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read website version
id: webver
run: echo "version=$(node -p "require('./website/package.json').version")" >> "$GITHUB_OUTPUT"
- name: Write latest-release.json for download page
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
run: |
gh api "repos/${{ github.repository }}/releases/latest" \
--jq '{tag_name: .tag_name, html_url: .html_url, published_at: .published_at, assets: [.assets[] | {name, browser_download_url, size}]}' \
> website/public/latest-release.json
- name: Docker Hub login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
type=sha,prefix=commit-
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./website
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
VITE_GITHUB_REPO=${{ github.repository }}
VITE_APP_VERSION=${{ steps.webver.outputs.version }}
VITE_RELEASE_TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }}
VITE_SITE_URL=${{ vars.WEBSITE_PUBLIC_URL || 'https://aerosol.januscaler.com' }}