Searching for all games fixed, added form validation and style update #99
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 of workflow | |
name: Generate a build and push to another branch | |
# When workflow is triggered | |
on: | |
push: | |
branches: | |
- main | |
# Jobs to carry out | |
jobs: | |
deploy: | |
# Operating system to run job on | |
runs-on: ubuntu-latest | |
name: Build and Push | |
env: | |
VITE_YOUTUBE_API_KEY: ${{ secrets.VITE_YOUTUBE_API_KEY }} | |
VITE_RAWG_API_KEY: ${{ secrets.VITE_RAWG_API_KEY }} | |
VITE_TWITCH_CLIENT_ID: ${{ secrets.VITE_TWITCH_CLIENT_ID }} | |
VITE_TWITCH_OAUTH_TOKEN: ${{ secrets.VITE_TWITCH_OAUTH_TOKEN }} | |
# Steps in job | |
steps: | |
# Get code from repo | |
- name: Checkout code | |
uses: actions/[email protected] | |
# Install NodeJS | |
- name: Use Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
# Run npm install and build on our code | |
- name: Install all dependencies | |
run: npm install | |
- name: Set up RAWG environment variables | |
run: echo "VITE_RAWG_API_KEY=${{ secrets.VITE_RAWG_API_KEY }}" > .env | |
- name: Set up YouTube environment variables | |
run: echo "VITE_YOUTUBE_API_KEY=${{ secrets.VITE_YOUTUBE_API_KEY }}" > .env | |
- name: Set up TWITCH CLIENT ID environment variables | |
run: echo "VITE_TWITCH_CLIENT_ID=${{ secrets.VITE_TWITCH_CLIENT_ID }}" > .env | |
- name: Set up TWITCH OAUTH TOKEN environment variables | |
run: echo "VITE_TWITCH_OAUTH_TOKEN=${{ secrets.VITE_TWITCH_OAUTH_TOKEN }}" > .env | |
- name: Build | |
run: npm run build | |
# Run Tests | |
# - name: Test | |
# run: npm run test if-present | |
# Deploy to Hostinger using our production secrets | |
- name: Deploy to Hostinger | |
uses: s0/git-publish-subdir-action@develop | |
env: | |
REPO: self | |
BRANCH: build | |
FOLDER: build #build artifacts | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
MESSAGE: "Build: ({sha}) {msg}" |