Skip to content

Commit

Permalink
add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
matan-h committed Jun 16, 2024
1 parent 5f4723a commit 8ed34e2
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Workflow for building and deploying a React site to GitHub Pages
name: Deploy React site to Page

on:
create:
tags:
- v*
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Build job
build:
name: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: Install dependencies
run: yarn install

- name: Build React App
run: CI=false yarn build

- name: Setup Pages
id: pages
uses: actions/configure-pages@v1

- name: Upload artifact
# This will automatically upload an artifact from the 'build' directory
uses: actions/upload-pages-artifact@v1
if: ${{ success() && github.ref == 'refs/heads/main' }}
with:
path: ./build/

# Deployment job
deploy:
name: deploy
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/main' }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
if: ${{ success() }}

0 comments on commit 8ed34e2

Please sign in to comment.