From 40309e6064749512597d62d13a5e90569ddaf81d Mon Sep 17 00:00:00 2001 From: Serge Ilyashenko Date: Sat, 24 Aug 2024 11:41:54 +0200 Subject: [PATCH] ci(homepage): deploy homepage --- .github/workflows/homepage-deploy.yml | 50 ++++++++++++++++++++++++ README.md | 10 +++-- apps/homepage/src/content/docs/index.mdx | 4 +- docs/deploy.md | 3 +- docs/monorepo.md | 1 + 5 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/homepage-deploy.yml diff --git a/.github/workflows/homepage-deploy.yml b/.github/workflows/homepage-deploy.yml new file mode 100644 index 0000000..1d4e101 --- /dev/null +++ b/.github/workflows/homepage-deploy.yml @@ -0,0 +1,50 @@ +name: homepage-deploy +run-name: deploy homepage to netlify 🚀 + +on: + push: + branches: + - master + paths: + - .github/workflows/homepage-deploy.yml +# - packages/**/* FIXME: do we need to watch packages ? + - apps/homepage/**/* + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + hompage-deploy-job: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install Netlify + run: npm install -g netlify-cli@17.22.1 + + - name: Install Dependencies + run: npm ci + + - name: Lint and test + run: npm run lint + + - name: Build + run: npm run build + + - name: Deploy to Netlify + id: netlify_deploy + run: | + netlify deploy \ + --prod \ + --dir apps/homepage/dist \ + --site ${{ secrets.NETLIFY_SIMPLE_PIE_2_SITE_ID }} \ + --auth ${{ secrets.NETLIFY_TOKEN }} \ + --filter homepage \ diff --git a/README.md b/README.md index 91aee41..94f0a3d 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,12 @@
-| project | badges | -|-----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------| -| [homepage](https://simple-pie.netlify.app/) | [![homepage-legacy Netlify deploy](https://github.com/serjilyashenko/simple-pie-project/actions/workflows/homepage-legacy-deploy.yml/badge.svg?branch=master)](https://github.com/serjilyashenko/simple-pie-project/actions/workflows/homepage-legacy-deploy.yml) | -| [simple-pie](./packages/simple-pie/README.md) | ![NPM Version](https://img.shields.io/npm/v/simple-pie) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/simple-pie)
![npm bundle size](https://img.shields.io/bundlephobia/min/simple-pie) ![NPM Downloads](https://img.shields.io/npm/dm/simple-pie) | +| project | badges | +|-----------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [homepage](https://simple-pie-2.netlify.app/) - 🚧WIP | TBD | +| [simple-pie](./packages/simple-pie/README.md) | ![NPM Version](https://img.shields.io/npm/v/simple-pie) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/simple-pie)
![npm bundle size](https://img.shields.io/bundlephobia/min/simple-pie) ![NPM Downloads](https://img.shields.io/npm/dm/simple-pie) | | [react-simple-pie](./packages/react-simple-pie/README.md) | ![NPM Version](https://img.shields.io/npm/v/react-simple-pie) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-simple-pie)
![npm bundle size](https://img.shields.io/bundlephobia/min/react-simple-pie) ![NPM Downloads](https://img.shields.io/npm/dm/react-simple-pie) | +| [homepage-legacy](https://simple-pie.netlify.app/) | [![homepage-legacy Netlify deploy](https://github.com/serjilyashenko/simple-pie-project/actions/workflows/homepage-legacy-deploy.yml/badge.svg?branch=master)](https://github.com/serjilyashenko/simple-pie-project/actions/workflows/homepage-legacy-deploy.yml) | ## Overview @@ -37,6 +38,7 @@ Simple-pie project is utilising a monorepo for a development and deployment. Rea simple-pie-project ├─ docs ├─ apps +│ ├─ homepage │ └─ homepage-legacy └─ packages ├─ pie-math diff --git a/apps/homepage/src/content/docs/index.mdx b/apps/homepage/src/content/docs/index.mdx index 22e85ec..04175ac 100644 --- a/apps/homepage/src/content/docs/index.mdx +++ b/apps/homepage/src/content/docs/index.mdx @@ -1,9 +1,9 @@ --- -title: Welcome to Simple Pie +title: WIP - Welcome to Simple Pie description: Get started building your docs site with Starlight. template: doc hero: - tagline: Congrats on setting up a new Starlight project! + tagline: WIP - Congrats on setting up a new Starlight project! image: file: ../../assets/houston.webp actions: diff --git a/docs/deploy.md b/docs/deploy.md index a7ea040..15c0b38 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -1,7 +1,6 @@ # Deploy -`homepage-legacy-deploy` is github-actions workflow. It deploys the legacy homepage -project to [Netlify](https://www.netlify.com). +`homepage` and `homepage-legacy-deploy` are github-actions workflows. They deploy the projects to [Netlify](https://www.netlify.com). The flow is inspired by [Raul Melo's article](https://www.raulmelo.me/en/blog/deploying-netlify-github-actions-guide). diff --git a/docs/monorepo.md b/docs/monorepo.md index f087d5d..705f5d2 100644 --- a/docs/monorepo.md +++ b/docs/monorepo.md @@ -20,6 +20,7 @@ simple-pie-project ├─ config ├─ docs ├─ apps +│ ├─ homepage │ └─ homepage-legacy └─ packages ├─ pie-math