fix: package.json & yarn.lock to reduce vulnerabilities #543
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy to Github Pages | |
on: [push] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "14" | |
- name: Set output Branch Name | |
id: vars | |
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} | |
- name: Update package.json homepage | |
uses: jossef/action-set-json-field@v1 | |
with: | |
file: package.json | |
field: homepage | |
value: "https://project-own.github.io/video_conference_front/${{ steps.vars.outputs.short_ref }}" | |
- name: Get yarn cache | |
id: yarn-cache | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ${{ steps.yarn-cache.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Install | |
run: yarn install --frozen-lockfile | |
- name: Build | |
env: | |
TURN_URL_1: ${{ secrets.TURN_URL_1 }} | |
TURN_CREDENTIAL_1: ${{ secrets.TURN_CREDENTIAL_1 }} | |
TURN_USERNAME_1: ${{ secrets.TURN_USERNAME_1 }} | |
TURN_URL_2: ${{ secrets.TURN_URL_1 }} | |
TURN_CREDENTIAL_2: ${{ secrets.TURN_CREDENTIAL_2 }} | |
TURN_USERNAME_2: ${{ secrets.TURN_USERNAME_2 }} | |
TURN_URL_3: ${{ secrets.TURN_URL_1 }} | |
TURN_CREDENTIAL_3: ${{ secrets.TURN_CREDENTIAL_3 }} | |
TURN_USERNAME_3: ${{ secrets.TURN_USERNAME_3 }} | |
run: yarn build | |
- name: Upload production-ready build files | |
uses: actions/upload-artifact@v2 | |
with: | |
name: production-files | |
path: ./build | |
deploy: | |
name: Deploy | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: production-files | |
path: ./build | |
- name: Set output Branch Name | |
id: vars | |
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/} | |
- name: Deploy Branches | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build | |
destination_dir: ${{ steps.vars.outputs.short_ref }} |