Skip to content

Commit 7e5ad96

Browse files
committed
[CI] Testing build and deploy image on docker hub
1 parent 48c155e commit 7e5ad96

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
11+
- uses: actions/setup-node@v4
12+
with:
13+
node-version: 20
14+
15+
- name: Cache node_modules
16+
uses: actions/cache@v4
17+
with:
18+
path: "node_modules"
19+
key: ${{ runner.os }}-modules-${{ hashFiles('package-lock.json') }}
20+
21+
- name: Install
22+
run: npm install
23+
24+
- name: Build
25+
run: npm run build
26+
env:
27+
NODE_OPTIONS: --max_old_space_size=4096
28+
29+
- name: Test
30+
id: test
31+
run: npm test

.github/workflows/deploy-docker.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish Docker image
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
workflow_dispatch:
7+
8+
env:
9+
REGISTRY: docker.io
10+
IMAGE_NAME: ouestware/gephi-lite
11+
12+
jobs:
13+
push_to_registry:
14+
name: Push Docker image to Docker Hub
15+
runs-on: ubuntu-latest
16+
permissions:
17+
packages: write
18+
contents: read
19+
attestations: write
20+
id-token: write
21+
steps:
22+
- name: Check out the repo
23+
uses: actions/checkout@v4
24+
25+
- name: Log in to Docker Hub
26+
uses: docker/login-action@v3
27+
with:
28+
username: ${{ secrets.DOCKER_USERNAME }}
29+
password: ${{ secrets.DOCKER_PASSWORD }}
30+
31+
- name: Extract metadata (tags, labels) for Docker
32+
id: meta
33+
uses: docker/metadata-action@v5
34+
with:
35+
images: ${{ env.IMAGE_NAME }}
36+
37+
- name: Build and push Docker image
38+
id: push
39+
uses: docker/build-push-action@v6
40+
with:
41+
context: .
42+
file: ./Dockerfile
43+
push: true
44+
tags: ${{ steps.meta.outputs.tags }}
45+
labels: ${{ steps.meta.outputs.labels }}
46+
47+
- name: Generate artifact attestation
48+
uses: actions/attest-build-provenance@v1
49+
with:
50+
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
51+
subject-digest: ${{ steps.push.outputs.digest }}
52+
push-to-registry: true

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default defineConfig({
1616
buildMode: true,
1717
},
1818
eslint: {
19-
lintCommand: "eslint --ext .ts,.tsx,.js,.jsx src",
19+
lintCommand: "eslint --ext .ts,.tsx,.js,.jsx src --max-warnings=0",
2020
},
2121
}),
2222
],

0 commit comments

Comments
 (0)