Skip to content

Change deploy.yml

Change deploy.yml #99

Workflow file for this run

name: Deploy Website
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
name: Deploying to surge
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Reconfigure git to use HTTP authentication
run: >
git config --global url."https://github.com/".insteadOf
ssh://[email protected]/
- name: Cache node modules
uses: actions/cache@v1
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: yarn install && cd web && yarn install
- name: Define env variable No.1
uses: TickX/[email protected]
with:
key: "BOT_SERVER_PATH"
value: ${{ secrets.BOT_SERVER_PATH }}
envPath: "./web/.env"
- name: Define env variable No.2
uses: TickX/[email protected]
with:
key: "YOUTUBE_API_KEY"
value: ${{ secrets.YOUTUBE_API_KEY }}
envPath: "./web/.env"
- name: Define env variable No.3
uses: TickX/[email protected]
with:
key: "SPOTIFY_CLIENT_ID"
value: ${{ secrets.SPOTIFY_CLIENT_ID }}
envPath: "./web/.env"
- name: Define env variable No.4
uses: TickX/[email protected]
with:
key: "SPOTIFY_CLIENT_SECRET"
value: ${{ secrets.SPOTIFY_CLIENT_SECRET }}
envPath: "./web/.env"
- name: Build
run: npm run build
working-directory: ./web
- name: Deploy
run: npx surge ./build ${{ secrets.SURGE_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }}
working-directory: ./web