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 70f2987
Show file tree
Hide file tree
Showing 11 changed files with 87 additions and 70 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
19 changes: 19 additions & 0 deletions .github/actions/deploy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: 'Deploy'
description: 'Deploy the project.'

runs:
using: 'composite'
steps:
- name: No jekyll
run: touch out/.nojekyll
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: out
clean: true
target-folder: .
git-config-name: ${{ github.actor }}
git-config-email: ${{ github.actor }}@users.noreply.github.com
commit-message: Deploy from commit ${{ github.sha }}
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

18 changes: 6 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ 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 }}
steps:
- name: Clone repository
uses: actions/checkout@v4
Expand All @@ -28,16 +33,5 @@ jobs:
node_version: 18
- name: Build
uses: ./.github/actions/build
with:
assets_path: 'assets'
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: out
clean: true
target-folder: .
git-config-name: ${{ github.actor }}
git-config-email: ${{ github.actor }}@users.noreply.github.com
commit-message: Deploy from commit ${{ github.sha }}
uses: ./.github/actions/deploy
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,
},
});
38 changes: 38 additions & 0 deletions app/manifest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import {MetadataRoute} from 'next';
import tailwindConfig from '../tailwind.config';

const colors = tailwindConfig.theme.extend.colors;
const {alternate = 'black'} = colors;

// eslint-disable-next-line jsdoc/require-jsdoc
export default function manifest(): MetadataRoute.Manifest {
return {
name: 'Salsaviva - Salsa, Bachata and Kizomba in Yerevan',
short_name: 'Salsaviva',
description: 'Social dance school in Yerevan',
theme_color: alternate,
background_color: alternate,
display: 'standalone',
orientation: 'portrait',
scope: '/',
start_url: '/',
icons: [
{
src: '/icons/logo_192.png',
type: 'image/png',
sizes: '192x192',
},
{
src: '/icons/logo_maskable_192.png',
type: 'image/png',
sizes: '192x192',
purpose: 'maskable',
},
{
src: '/icons/logo_512.png',
type: 'image/png',
sizes: '512x512',
},
],
};
}
1 change: 0 additions & 1 deletion app/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const metadata: Metadata = {
'social dance',
],
authors: [{name: 'Ukorvl', url: 'https://github.com/ukorvl'}],
manifest: '/manifest.json',
metadataBase: new URL(origin),
openGraph: {
title: 'Salsaviva',
Expand Down
30 changes: 0 additions & 30 deletions public/manifest.json

This file was deleted.

0 comments on commit 70f2987

Please sign in to comment.