Skip to content

Commit

Permalink
app version
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Apr 6, 2023
1 parent 1892e04 commit e2b4977
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"

- name: "set app version to env"
env:
NEXT_PUBLIC_APP_VERSION: ${{ steps.previoustag.outputs.tag }}"

- name: Extract version number
id: extract_version
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dev_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ jobs:
- name: Create short sha
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: "set app version to env"
env:
NEXT_PUBLIC_APP_VERSION: v${{ github.ref_name }}-${{ env.SHORT_SHA }}"

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
Expand Down
1 change: 1 addition & 0 deletions init-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ cat << EOF > .env
DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}?schema=public
ZT_ADDR=${ZT_ADDR}
NEXT_PUBLIC_SITE_NAME=${NEXT_PUBLIC_SITE_NAME}
NEXT_PUBLIC_APP_VERSION=${NEXT_PUBLIC_APP_VERSION}
EOF

until PGPASSWORD=$POSTGRES_PASSWORD psql -h "$POSTGRES_HOST" -U "$POSTGRES_USER" -c '\q'; do
Expand Down
14 changes: 2 additions & 12 deletions src/components/layouts/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ReactNode } from "react";
import Header from "../modules/header";
import Sidebar from "../modules/sidebar";
import Footer from "../modules/footer";

interface Props {
children: ReactNode;
Expand All @@ -18,18 +19,7 @@ export const LayoutAuthenticated = ({ children }: Props): JSX.Element => {
<Sidebar />
<div className="grid w-full grid-rows-[1fr,auto]">
{children}
<footer className="hidden px-4 py-6 sm:block">
<div className="">
<p className="text-center text-sm text-gray-600">
© Kodea Solutions {new Date().getFullYear()}. All rights
reserved
<a href="https://uavmatrix.com">
{" "}
by Bernt Christian Egeland / aka @sinamics
</a>
</p>
</div>
</footer>
<Footer />
</div>
</div>
</div>
Expand Down
25 changes: 25 additions & 0 deletions src/components/modules/footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";

const Footer = () => (
<footer className="hidden px-4 py-6 sm:block">
<div className="grid grid-cols-3">
<div></div>
<p className="text-center text-sm text-gray-600">
© Kodea Solutions {new Date().getFullYear()}. All rights reserved
<a href="https://uavmatrix.com">
{" "}
by Bernt Christian Egeland / aka @sinamics
</a>
</p>
{process.env.NEXT_PUBLIC_APP_VERSION ? (
<p className="text-right text-sm text-gray-600">
{process.env.NEXT_PUBLIC_APP_VERSION}
</p>
) : (
<div></div>
)}
</div>
</footer>
);

export default Footer;

0 comments on commit e2b4977

Please sign in to comment.