Compare commits

...

16 Commits

Author SHA1 Message Date
efaa02ae20 Footer with environment, build, and hash
All checks were successful
Build and Test - Staging / determine_version (pull_request) Successful in 5s
Build and Test - Staging / build_and_push (pull_request) Successful in 41s
Build and Test - Staging / test (pull_request) Successful in 1s
Build and Test - Staging / deploy_staging (pull_request) Successful in 3s
2025-07-09 03:42:23 -07:00
396b6d210b Merge pull request 'Add version, hash, and environment as build variables' (#4) from staging-build into main
All checks were successful
Build and Test - Production / determine_version (push) Successful in 5s
Build and Test - Production / build_and_push (push) Successful in 42s
Build and Test - Production / test (push) Successful in 2s
Build and Test - Production / deploy_production (push) Successful in 3s
Reviewed-on: #4
2025-07-09 10:14:03 +00:00
594bc9bc4f No sleep, just need to call start and not stop...
All checks were successful
Build and Test - Staging / determine_version (pull_request) Successful in 6s
Build and Test - Staging / build_and_push (pull_request) Successful in 42s
Build and Test - Staging / test (pull_request) Successful in 1s
Build and Test - Staging / deploy_staging (pull_request) Successful in 2s
2025-07-09 03:12:21 -07:00
e4a87c3941 Deployment needs sleep after stopping
All checks were successful
Build and Test - Staging / build_and_push (pull_request) Successful in 41s
Build and Test - Staging / test (pull_request) Successful in 2s
Build and Test - Staging / determine_version (pull_request) Successful in 5s
Build and Test - Staging / deploy_staging (pull_request) Successful in 7s
2025-07-09 03:09:49 -07:00
3ba6db7f83 Make variables public
All checks were successful
Build and Test - Staging / determine_version (pull_request) Successful in 6s
Build and Test - Staging / build_and_push (pull_request) Successful in 40s
Build and Test - Staging / test (pull_request) Successful in 2s
Build and Test - Staging / deploy_staging (pull_request) Successful in 3s
2025-07-09 03:06:30 -07:00
b37ee3f94c Add version, hash, and environment as build variables 2025-07-09 03:04:22 -07:00
da2fc876d4 Merge pull request 'Commonize builds, add staging build' (#3) from staging-build into main
All checks were successful
Build and Test - Production / determine_version (push) Successful in 5s
Build and Test - Production / build_and_push (push) Successful in 44s
Build and Test - Production / test (push) Successful in 2s
Build and Test - Production / deploy_production (push) Successful in 3s
Reviewed-on: #3
2025-07-09 09:45:13 +00:00
4c6aa09c12 Staging to stg
All checks were successful
Build and Test - Staging / determine_version (pull_request) Successful in 6s
Build and Test - Staging / build_and_push (pull_request) Successful in 41s
Build and Test - Staging / test (pull_request) Successful in 1s
Build and Test - Staging / deploy_staging (pull_request) Successful in 2s
2025-07-09 02:40:34 -07:00
88996012d7 Revert to copy/paste for now for staging
All checks were successful
Build and Test - Staging / build_and_push (pull_request) Successful in 42s
Build and Test - Staging / test (pull_request) Successful in 1s
Build and Test - Staging / determine_version (pull_request) Successful in 6s
Build and Test - Staging / deploy_staging (pull_request) Successful in 3s
2025-07-09 02:37:04 -07:00
cb2c9dece3 Add manual jobs from common
All checks were successful
Build and Test Staging / determine_version (pull_request) Successful in 7s
Build and Test Staging / build_and_push (pull_request) Successful in 6s
Build and Test Staging / deploy_production (pull_request) Successful in 6s
Build and Test Staging / test (pull_request) Successful in 5s
2025-07-09 02:32:18 -07:00
d6a3341944 Actually assign environment variable for deploy targets and docker tags
All checks were successful
Build and Test Staging / build_test_deploy (pull_request) Successful in 6s
2025-07-09 02:24:55 -07:00
bb39ed567f No longer using array in bash docker tag generation
All checks were successful
Build and Test Staging / build_test_deploy (pull_request) Has been skipped
2025-07-09 02:22:05 -07:00
548118e13e Add missing $
All checks were successful
Build and Test Staging / build_test_deploy (pull_request) Has been skipped
2025-07-09 02:18:05 -07:00
3ecb9b2994 Commonize builds, add staging build
All checks were successful
Build and Test Staging / build_test_deploy (pull_request) Has been skipped
2025-07-09 02:11:04 -07:00
7de03b565a Merge pull request 'Import styles from correct path' (#2) from website-content-updates into main
All checks were successful
Build and Test / determine_version (push) Successful in 11s
Build and Test / build_and_push (push) Successful in 2m58s
Build and Test / test (push) Successful in 2s
Build and Test / deploy_production (push) Successful in 3s
Reviewed-on: #2
2025-07-04 07:36:42 +00:00
0924c7ba00 Merge pull request 'website-content-updates' (#1) from website-content-updates into main
Some checks failed
Build and Test / determine_version (push) Successful in 47s
Build and Test / build_and_push (push) Failing after 2m15s
Build and Test / test (push) Has been skipped
Build and Test / deploy_production (push) Has been skipped
Reviewed-on: #1
2025-07-04 07:31:55 +00:00
6 changed files with 132 additions and 8 deletions

View File

@@ -1,4 +1,4 @@
name: Build and Test
name: Build and Test - Production
on:
push:
branches: [main]
@@ -52,6 +52,10 @@ jobs:
gitea.perren.cloud/caperren/${{ needs.determine_version.outputs.repo_name }}:${{ needs.determine_version.outputs.repo_version_hash }}
gitea.perren.cloud/caperren/${{ needs.determine_version.outputs.repo_name }}:${{ needs.determine_version.outputs.project_version }}
gitea.perren.cloud/caperren/caperren-com:latest
build-args: |
REPO_VERSION_HASH=${{ needs.determine_version.outputs.repo_version_hash }}
PROJECT_VERSION=${{ needs.determine_version.outputs.project_version }}
BUILD_ENVIRONMENT=production
test:
runs-on: ubuntu-latest
@@ -85,8 +89,8 @@ jobs:
- name: Start App
run: |
curl -k -X 'POST' \
'https://caperren.com:444/api/v2.0/app/stop' \
'https://caperren.com:444/api/v2.0/app/start' \
-H 'accept: */*' \
-H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '"caperren-com"'
-d '"caperren-com"'

View File

@@ -0,0 +1,95 @@
name: Build and Test - Staging
on:
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
determine_version:
runs-on: ubuntu-latest
outputs:
repo_name: ${{ steps.project_metadata.outputs.REPO_NAME }}
repo_version_hash: ${{ steps.project_metadata.outputs.REPO_VERSION_HASH }}
project_version: ${{ steps.project_metadata.outputs.PROJECT_VERSION }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node Environment
uses: actions/setup-node@v4
- name: Acquire Project Metadata
id: project_metadata
run: |
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
echo REPO_VERSION_HASH=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
echo PROJECT_VERSION=$(npm pkg get version --workspaces=false | tr -d \") >> $GITHUB_OUTPUT
build_and_push:
runs-on: ubuntu-latest
needs: determine_version
steps:
- name: Checkout caperren-com Repository
uses: actions/checkout@v4
with:
path: caperren-com
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: gitea.perren.cloud
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.ACTIONS_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and Push
uses: docker/build-push-action@v5
with:
context: caperren-com
push: true
tags: |
gitea.perren.cloud/caperren/caperren-com:latest-staging
build-args: |
REPO_VERSION_HASH=${{ needs.determine_version.outputs.repo_version_hash }}
PROJECT_VERSION=${{ needs.determine_version.outputs.project_version }}
BUILD_ENVIRONMENT=staging
test:
runs-on: ubuntu-latest
needs: build_and_push
steps:
- run: echo "Placeholder"
deploy_staging:
runs-on: ubuntu-latest
needs: test
steps:
- name: Pull New Image For App
run: |
curl -k -X 'POST' \
'https://caperren.com:444/api/v2.0/app/pull_images' \
-H 'accept: */*' \
-H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '{
"name": "caperren-com-stg",
"options": {}
}'
- name: Stop App
run: |
curl -k -X 'POST' \
'https://caperren.com:444/api/v2.0/app/stop' \
-H 'accept: */*' \
-H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '"caperren-com-stg"'
- name: Start App
run: |
curl -k -X 'POST' \
'https://caperren.com:444/api/v2.0/app/start' \
-H 'accept: */*' \
-H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \
-H 'Content-Type: application/json' \
-d '"caperren-com-stg"'

View File

@@ -12,7 +12,16 @@ FROM base AS build-deps
RUN npm install
FROM build-deps AS build
COPY . .
ARG REPO_VERSION_HASH
ARG BUILD_ENVIRONMENT
ARG PROJECT_VERSION
RUN echo "PUBLIC_REPO_VERSION_HASH=/"${REPO_VERSION_HASH}/" \n\
BUILD_ENVIRONMENT=/"${BUILD_ENVIRONMENT}/" \n\
PUBLIC_PROJECT_VERSION=/"${PROJECT_VERSION}/"" >> nope
RUN npm run build
FROM httpd:latest AS runtime

View File

@@ -0,0 +1,5 @@
---
---
<footer class="flex justify-center items-center text-center">
{import.meta.env.BUILD_ENVIRONMENT || "development"} | {import.meta.env.PUBLIC_REPO_VERSION_HASH || "invalid"}@{import.meta.env.PUBLIC_PROJECT_VERSION || "0.0.0"}
</footer>

9
src/env.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
interface ImportMetaEnv {
readonly PUBLIC_REPO_VERSION_HASH: string;
readonly PUBLIC_PROJECT_VERSION: string;
readonly BUILD_ENVIRONMENT: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}

View File

@@ -1,20 +1,22 @@
---
import '../styles/global.css'
import Navbar from '../components/Navbar.astro';
import Footer from '../components/Footer.astro';
const pageTitle = Astro.props.title ? `${Astro.props.title} - Corwin Perren`: "Corwin Perren";
const pageTitle = Astro.props.title ? `${Astro.props.title} - Corwin Perren` : "Corwin Perren";
---
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>{pageTitle}</title>
</head>
<body>
<Navbar />
<Navbar/>
<main style="padding: 2rem;">
<slot />
<slot/>
</main>
<Footer/>
</body>
</html>