forked from MaibornWolff/codecharta
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 1.95 KB
/
staging-visualization.yml
File metadata and controls
70 lines (60 loc) · 1.95 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
68
69
70
name: Staging Deployment - Visualization
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'visualization/**'
env:
SHORT_SHA: "0000000"
jobs:
build_and_deploy:
name: Build and Deploy
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Build visualization
env:
NODE_OPTIONS: "--max_old_space_size=4096"
working-directory: ./visualization
run: |
npm ci || (echo "npm ci failed, regenerating lock file and retrying..." && npm install --package-lock-only && npm ci)
npm run build
# Get short SHA for tagging
- name: Set short SHA
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# Docker build and push with staging tags
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: ./visualization
push: true
tags: |
codecharta/codecharta-visualization:staging
codecharta/codecharta-visualization:staging-${{ env.SHORT_SHA }}
- name: Create Sample File for Web Demo
run: sh ./.github/workflows/scripts/build_demo_files.sh
# Deploy to GitHub Pages staging environment
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.8.0
with:
token: ${{ secrets.DEPLOY_TOKEN }}
branch: gh-pages
folder: visualization/dist/bundler/browser
target-folder: stg/visualization
clean: true