mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-12 02:45:34 +08:00
* initial commit * starting deploy script * filename update * requirements * file * branch name * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * lazy commit * Update viewer_build_deploy.yml * reading version from package json * still deploy to branches * update version
99 lines
2.8 KiB
YAML
99 lines
2.8 KiB
YAML
name: Viewer Build and Deploy.
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./nerfactory/viewer/app
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@master
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 17.8.0
|
|
cache: 'yarn'
|
|
cache-dependency-path: ./nerfactory/viewer/app/yarn.lock
|
|
|
|
- name: Install packages
|
|
run: yarn install
|
|
|
|
- name: Build project
|
|
run: CI=false yarn build
|
|
|
|
- name: Upload production-ready build files
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: production-files
|
|
path: ./nerfactory/viewer/app/build
|
|
|
|
deploy:
|
|
name: Deploy
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
# if: github.ref == 'refs/heads/master'
|
|
|
|
env:
|
|
SSH_KEY: ${{secrets.SSH_KEY}}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Set up Python 3.8.12
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: '3.8.12'
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install -r ./nerfactory/viewer/app/requirements.txt
|
|
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: production-files
|
|
path: ./nerfactory/viewer/app/build
|
|
|
|
- name: Get branch name (merge)
|
|
if: github.event_name != 'pull_request'
|
|
shell: bash
|
|
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV
|
|
|
|
- name: Get branch name (pull request)
|
|
if: github.event_name == 'pull_request'
|
|
shell: bash
|
|
run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV
|
|
|
|
# TODO: detect file or scheme changes of the viewer and only
|
|
# increment the version.txt file when there is a change.
|
|
# Update the version.txt code and push to master when things change.
|
|
# https://github.com/marketplace/actions/changed-files
|
|
- name: Run changed-files with defaults on the dir1
|
|
id: changed-files-for-dir1
|
|
uses: tj-actions/changed-files@v29.0.3
|
|
with:
|
|
path: nerfactory/viewer/app
|
|
|
|
- name: List all added files in dir1
|
|
run: |
|
|
for file in ${{ steps.changed-files-for-dir1.outputs.modified_files }}; do
|
|
echo "$file was modified"
|
|
done
|
|
|
|
- run: |
|
|
python ./nerfactory/viewer/app/run_deploy.py \
|
|
--branch-name ${{ env.BRANCH_NAME }} \
|
|
--ssh-key-string "$SSH_KEY" \
|
|
--local-folder ./nerfactory/viewer/app/build \
|
|
--package-json-filename ./nerfactory/viewer/app/package.json \
|
|
--increment-version "False"
|
|
- run: cat ~/.ssh/config
|