Skip to content

Commit

Permalink
ci file
Browse files Browse the repository at this point in the history
  • Loading branch information
kornzhoudev committed May 26, 2023
1 parent bfa610d commit ce0b771
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 47 deletions.
28 changes: 28 additions & 0 deletions .github/actions/cahced-deps/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Get & Cache Dependencies'
description: 'Get the dependencies (via npm) and cache them'
inputs:
caching:
description: 'whether to cache dependencies or not.'
required: false
default: 'true'
outputs:
used-cache:
description: 'Whether cache was used'
value: ${{ steps.install.outputs.cache }}
runs:
using: 'composite'
steps:
- name: Cache dependencies
if: inputs.caching == 'true'
id: cache
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
id: install
if: steps.cache.outputs.cache-hit != 'true' || inputs.caching != 'true'
run: |
npm ci
echo "cache='${{ inputs.caching }}'" >> $GITHUB_OUTPUT
shell: bash
40 changes: 40 additions & 0 deletions .github/workflow/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Async-gpt-frontend
on:
pull_request:
types:
- opened
branches:
- main
paths:
- '.github/workflows/*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Load & cache dependencies
id: cache-dependencies
uses: ./.github/actions/cached-deps
with:
caching: 'false'
- name: Build website
run: npm run build
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: out-files
path: out

deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Get code
uses: actions/checkout@v3
- name: Get build artifacts
uses: actions/download-artifact@v3
with:
name: out-files
path: out
47 changes: 0 additions & 47 deletions .github/workflows/build-and-deploy.yaml

This file was deleted.

0 comments on commit ce0b771

Please sign in to comment.