Skip to content

Commit 895f306

Browse files
committed
Publish Docker image
1 parent 890bfc2 commit 895f306

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

.github/workflows/ci.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
---
22
name: CI
3+
34
on:
45
push:
56
branches:
67
- master
8+
tags:
9+
- "*"
710
pull_request:
811
branches:
912
- master
1013
workflow_dispatch:
14+
inputs:
15+
use_cache:
16+
description: "Use build cache"
17+
required: true
18+
type: boolean
19+
default: true
20+
21+
env:
22+
REGISTRY: ghcr.io
23+
IMAGE_NAME: ${{ github.repository }}
24+
1125
jobs:
1226
build:
1327
runs-on: ubuntu-latest
@@ -72,3 +86,87 @@ jobs:
7286
run: pnpm lhci autorun
7387
env:
7488
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
89+
90+
docker:
91+
runs-on: ubuntu-latest
92+
needs: build
93+
permissions:
94+
contents: read
95+
packages: write
96+
id-token: write
97+
attestations: write
98+
steps:
99+
- name: Checkout repository
100+
uses: actions/checkout@v5
101+
102+
- name: Set up QEMU
103+
uses: docker/setup-qemu-action@v3
104+
with:
105+
platforms: all
106+
107+
- name: Setup Docker buildx
108+
uses: docker/setup-buildx-action@v3
109+
110+
# Login against a Docker registry except on PR
111+
# https://github.com/docker/login-action
112+
- name: Log into registry ${{ env.REGISTRY }}
113+
if: github.event_name != 'pull_request'
114+
uses: docker/login-action@v3.4.0
115+
with:
116+
registry: ${{ env.REGISTRY }}
117+
username: ${{ github.actor }}
118+
password: ${{ secrets.GITHUB_TOKEN }}
119+
120+
- name: Extract Docker metadata
121+
id: meta
122+
uses: docker/metadata-action@v5
123+
with:
124+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
125+
labels: |
126+
org.opencontainers.image.title=Fluorite
127+
org.opencontainers.image.description=An elegant PWA video player
128+
org.opencontainers.image.authors=AFCMS <afcm.contact@gmail.com>
129+
org.opencontainers.image.licenses=GPL-3.0-only
130+
org.opencontainers.image.source=https://github.com/AFCMS/fluorite
131+
io.artifacthub.package.logo-url=https://raw.githubusercontent.com/AFCMS/fluorite/refs/heads/master/public/fluorite.svg
132+
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/AFCMS/fluorite/refs/heads/master/README.md
133+
io.artifacthub.package.category=skip-prediction
134+
io.artifacthub.package.keywords=video-player,offline,pwa
135+
io.artifacthub.package.license=GPL-3.0-only
136+
io.artifacthub.package.maintainers=[{"name":"AFCMS","email":"afcm.contact@gmail.com"}]
137+
annotations: |
138+
org.opencontainers.image.title=Fluorite
139+
org.opencontainers.image.description=An elegant PWA video player
140+
org.opencontainers.image.authors=AFCMS <afcm.contact@gmail.com>
141+
org.opencontainers.image.licenses=GPL-3.0-only
142+
org.opencontainers.image.source=https://github.com/AFCMS/fluorite
143+
io.artifacthub.package.logo-url=https://raw.githubusercontent.com/AFCMS/fluorite/refs/heads/master/public/fluorite.svg
144+
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/AFCMS/fluorite/refs/heads/master/README.md
145+
io.artifacthub.package.category=skip-prediction
146+
io.artifacthub.package.keywords=video-player,offline,pwa
147+
io.artifacthub.package.license=GPL-3.0-only
148+
io.artifacthub.package.maintainers=[{"name":"AFCMS","email":"afcm.contact@gmail.com"}]
149+
150+
# Build and push Docker image with Buildx (don't push on PR)
151+
# https://github.com/docker/build-push-action
152+
- name: Build and push Docker image
153+
id: build-and-push
154+
uses: docker/build-push-action@v6
155+
with:
156+
context: .
157+
file: Dockerfile
158+
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7,linux/ppc64le,linux/riscv64,linux/s390x
159+
push: ${{ github.event_name != 'pull_request' }}
160+
tags: ${{ steps.meta.outputs.tags }}
161+
labels: ${{ steps.meta.outputs.labels }}
162+
cache-from: type=gha
163+
cache-to: type=gha,mode=max
164+
no-cache: ${{ (github.event_name == 'workflow_dispatch' && !inputs.use_cache) || startsWith(github.ref, 'refs/tags/') }}
165+
166+
- name: Attest Build Provenance
167+
if: github.event_name != 'pull_request'
168+
uses: actions/attest-build-provenance@v3
169+
with:
170+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
171+
subject-digest: ${{ steps.build-and-push.outputs.digest }}
172+
push-to-registry: false

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ LABEL io.artifacthub.package.keywords="video-player,offline,pwa"
1515
LABEL io.artifacthub.package.license="GPL-3.0-only"
1616
LABEL io.artifacthub.package.maintainers='[{"name":"AFCMS","email":"afcm.contact@gmail.com"}]'
1717

18+
ENV VITE_DISABLE_VERCEL_ANALYTICS="true"
19+
1820
RUN corepack enable pnpm
1921

2022
WORKDIR /app

0 commit comments

Comments
 (0)