Skip to content

Commit

Permalink
minor deploy and workflow changes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl committed Jun 24, 2024
1 parent 99d394a commit 582a6d5
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 36 deletions.
9 changes: 9 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: "Build"
description: "Build the project."

runs:
using: "composite"
steps:
- name: Build
shell: bash
run: npm run build
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: "Test"
description: "Lint and test the project."
name: 'Test'
description: 'Lint and test the project.'

runs:
using: "composite"
using: 'composite'
steps:
- name: Lint
shell: bash
run: |
npm run lint
npm run lint:editorconfig
- name: Prettier rules check
shell: bash
run: npm run prettier-check
- name: e2e
uses: cypress-io/github-action@v5
Expand All @@ -17,4 +19,5 @@ runs:
start: npm start
record: false
- name: Check seo
shell: bash
run: npm run check-seo
21 changes: 0 additions & 21 deletions .github/workflows/actions/build/action.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,13 @@ concurrency:

jobs:
build:
name: Build
name: Build on Node.js ${{ matrix.version }}
runs-on: ubuntu-latest
env:
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
FORMSPREE_ID: ${{ secrets.FORMSPREE_ID }}
HOTJAR_ID: ${{ secrets.HOTJAR_ID }}
HOTJAR_SNIPPET_VERSION: ${{ secrets.HOTJAR_SNIPPET_VERSION }}
strategy:
matrix:
version: [18, 20, 22]
Expand All @@ -26,4 +31,3 @@ jobs:
uses: ./.github/actions/test
- name: Build
uses: ./.github/actions/build

8 changes: 6 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
env:
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
FORMSPREE_ID: ${{ secrets.FORMSPREE_ID }}
HOTJAR_ID: ${{ secrets.HOTJAR_ID }}
HOTJAR_SNIPPET_VERSION: ${{ secrets.HOTJAR_SNIPPET_VERSION }}
ASSETS_BASE_PATH: /salsaviva
steps:
- name: Clone repository
uses: actions/checkout@v4
Expand All @@ -28,8 +34,6 @@ jobs:
node_version: 18
- name: Build
uses: ./.github/actions/build
with:
assets_path: 'assets'
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
4 changes: 3 additions & 1 deletion app/env.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {createEnv} from '@t3-oss/env-nextjs';
import {z} from 'zod';
import {any, z} from 'zod';

/**
* Checks if a string is not empty.
Expand Down Expand Up @@ -35,6 +35,7 @@ const server = {
CONTACT_PHONE: notEmptyString,
LOCATION_GOOGLE_MAPS_LINK: notEmptyString.url(),
LOCATION_ADDRESS_TEXT: notEmptyString,
ASSETS_BASE_PATH: any(),
};

const client = {};
Expand Down Expand Up @@ -62,5 +63,6 @@ export const env = createEnv({
CONTACT_PHONE: process.env.CONTACT_PHONE,
LOCATION_GOOGLE_MAPS_LINK: process.env.LOCATION_GOOGLE_MAPS_LINK,
LOCATION_ADDRESS_TEXT: process.env.LOCATION_ADDRESS_TEXT,
ASSETS_BASE_PATH: process.env.ASSETS_BASE_PATH,
},
});
15 changes: 9 additions & 6 deletions app/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

import {Metadata} from 'next';
import {origin} from './origin';
import {env} from './env.mjs';

const {ASSETS_BASE_PATH = ''} = env;

const metadata: Metadata = {
title: {
Expand All @@ -24,14 +27,14 @@ const metadata: Metadata = {
'social dance',
],
authors: [{name: 'Ukorvl', url: 'https://github.com/ukorvl'}],
manifest: '/manifest.json',
manifest: `${ASSETS_BASE_PATH}/manifest.json`,
metadataBase: new URL(origin),
openGraph: {
title: 'Salsaviva',
description: 'Salsa, Bachata and Kizomba in Yerevan',
images: [
{
url: '/og.jpg',
url: `${ASSETS_BASE_PATH}/og.jpg`,
width: 800,
height: 600,
},
Expand All @@ -45,24 +48,24 @@ const metadata: Metadata = {
card: 'summary_large_image',
title: 'Salsaviva',
description: 'Salsa, Bachata and Kizomba in Yerevan',
images: ['/og.jpg'],
images: [`${ASSETS_BASE_PATH}/og.jpg`],
site: '@salsaviva',
},
icons: [
{
rel: 'icon',
sizes: 'any',
url: '/icons/favicon.ico',
url: `${ASSETS_BASE_PATH}/icons/icon.png`,
},
{
rel: 'icon',
type: 'image/svg+xml',
url: '/icons/icon.svg',
url: `${ASSETS_BASE_PATH}/icons/icon.svg`,
},
{
rel: 'apple-touch-icon',
sizes: '180x180',
url: '/icons/apple-touch-icon.png',
url: `${ASSETS_BASE_PATH}/icons/apple-touch-icon.png`,
},
],
robots: {
Expand Down
1 change: 0 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const nextConfig = {
unoptimized: true,
},
basePath: process.env.ASSETS_BASE_PATH ?? '',
assetPrefix: process.env.ASSETS_BASE_PATH ?? '',
};

const withAnalyzer = withBundleAnalyzer({
Expand Down

0 comments on commit 582a6d5

Please sign in to comment.