hedgedoc/.github/workflows/frontend-netlify-deploy-main.yml
Erik Michelson bced0c478b enhancement: remove frontend version
As frontend and backend are managed inside a monorepo and distributed together, there is no sense in keeping separate frontend and backend version information.

Signed-off-by: Erik Michelson <github@erik.michelson.eu>
2023-04-03 20:11:03 +02:00

64 lines
1.8 KiB
YAML

# SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
#
# SPDX-License-Identifier: AGPL-3.0-only
name: Frontend / Deploy develop branch to Netlify
on:
push:
branches: [ develop ]
env:
NETLIFY_VERSION: 12.0.11
NODEJS_VERSION: 18
defaults:
run:
working-directory: frontend
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.job }}
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploys to netlify
steps:
- name: Checkout repository
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Setup node
uses: ./.github/actions/setup-node
with:
NODEJS_VERSION: ${{ env.NODEJS_VERSION }}
- name: Patch intro.md to include netlify banner.
run: cp netlify/intro.md public/public/intro.md
- name: Patch motd.md to include privacy policy.
run: cp netlify/motd.md public/public/motd.md
- name: Patch base URL
run: echo "HD_BASE_URL=\"https://hedgedoc.dev/\"" >> .env.production
- name: Build app
run: yarn turbo run build --filter=frontend
shell: bash
working-directory: .
env:
NEXT_PUBLIC_USE_MOCK_API: true
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_API: ${{ vars.TURBO_API }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
- name: Remove Next.js cache to avoid it being deployed
run: rm -r .next/cache
- name: Install netlify CLI
run: "npm install -g netlify-cli@${{ env.NETLIFY_VERSION }}"
- name: Run netlify CLI deployment
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: "netlify deploy --build --prod --message \"${{ github.event.head_commit.id }}: ${{ github.event.head_commit.message }}\""