Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 29 additions & 30 deletions .github/workflows/deploy-sophora-components.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
name: 'Deploy sophora-components'
name: Deploy sophora-components

on:
workflow_dispatch:
push:
paths:
- 'sophora-components/**'
branches:
- main
pull_request:
paths:
- 'sophora-components/**'
types: [opened, synchronize]

permissions:
contents: write
pull-requests: write
id-token: write

jobs:
build-deploy:
runs-on: ubuntu-latest
env:
BASE_PATH: '/apps/sophora-components/${{ github.head_ref || github.ref_name }}'
ASSETS_PATH: 'https://static.datenhub.net/apps/sophora-components/${{ github.head_ref || github.ref_name }}'
defaults:
run:
working-directory: ./sophora-components
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24
- name: Create .env file for production
run: |
touch .env
echo BASE_PATH=$BASE_PATH >> .env
echo ASSETS_PATH=$ASSETS_PATH >> .env
- run: npm ci
- run: npm run build
- uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
- name: 'Upload files to GCP'
uses: 'google-github-actions/upload-cloud-storage@v2'
with:
path: './sophora-components/build'
parent: false
destination: 'datenhub-net-static/apps/sophora-components/${{ github.head_ref || github.ref_name }}/'
reuse-build-and-deploy-node-app:
uses: SWRData/workflows-swr-data-lab/.github/workflows/build_and_deploy_node_app.yml@9ba3b1759882ad4dcc1128985a0ab0cb4783f53e
with:
full_repository: ${{ github.repository }}
branch: ${{ github.head_ref || github.ref_name }}
working_directory: 'sophora-components'
node_version: 24
install_command: 'npm ci'
build_command: 'npm run build'
build_path: 'build'
secrets:
SWR_NPM_TOKEN: ${{ secrets.SWR_NPM_TOKEN }}
Loading