started ci and migrations

This commit is contained in:
2026-01-16 16:05:27 +11:00
parent 77cc5273ac
commit b358d84f4d
4 changed files with 1794 additions and 56 deletions

View File

@@ -1,70 +1,97 @@
# name: Build and Push Container
name: Build and Push Container
# on:
# push:
# branches:
# - '**'
# pull_request:
# branches:
# - '**'
# workflow_dispatch:
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
workflow_dispatch:
# jobs:
# build:
# name: Build App
# runs-on: ubuntu-latest
jobs:
build:
name: Build App
runs-on: ubuntu-latest
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v4
steps:
- name: Checkout Repo
uses: actions/checkout@v4
# - name: Setup Node.js
# uses: actions/setup-node@v4
# with:
# node-version: 24
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
# - name: Setup PNPM
# uses: pnpm/action-setup@v4
- name: Setup PNPM
uses: pnpm/action-setup@v4
# - name: Install Dependencies
# run: pnpm i --frozen-lockfile
- name: Install Dependencies
run: pnpm i --frozen-lockfile
# - name: Build App
# run: pnpm run build
- name: Write Environment File
run: |
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> .env
echo "PAYLOAD_SECRET=BUILD" >> .env
# publish:
# if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
# name: Publish App
# runs-on: ubuntu-latest
# needs: build
- name: Build App
run: pnpm run build
# steps:
# - name: Checkout Repo
# uses: actions/checkout@v4
publish:
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
name: Publish App
runs-on: ubuntu-latest
needs: build
# - name: Setup Docker Metadata
# uses: docker/metadata-action@v5
# id: metadata
# with:
# images: liamsgit.dev/LiamPietralla/liam-portfolio
# tags: |
# type=raw,value=latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
# - name: Login To Docker Registry
# uses: docker/login-action@v3
# with:
# registry: liamsgit.dev
# username: ${{ secrets.REGISTRY_USERNAME }}
# password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Setup Docker Metadata
uses: docker/metadata-action@v5
id: metadata
with:
images: liamsgit.dev/LiamPietralla/liam-portfolio
tags: |
type=raw,value=latest
# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v3
- name: Login To Docker Registry
uses: docker/login-action@v3
with:
registry: liamsgit.dev
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
# - name: Build and Push Image
# uses: docker/build-push-action@v6
# with:
# file: Dockerfile
# push: true
# tags: ${{ steps.metadata.outputs.tags }}
# labels: ${{ steps.metadata.outputs.labels }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# - name: Build and Push Image
# uses: docker/build-push-action@v6
# with:
# file: Dockerfile
# push: true
# tags: ${{ steps.metadata.outputs.tags }}
# labels: ${{ steps.metadata.outputs.labels }}
# build-args: |
# DATABASE_URL=${{ secrets.DATABASE_URL }}
# - name: Install dependencies
# run: pnpm install --frozen-lockfile
# - name: Run Migrations
# run: pnpm --filter amoc payload migrate
# env:
# DATABASE_URL: ${{ secrets.DATABASE_URL }}
# - name: Setup Nomad
# uses: hashicorp/setup-nomad@main
# with:
# nomad_version: '1.10.5'
# - name: Deploy Job to Nomad
# run: |
# export DEPLOYMENT_VERSION="${GITHUB_SHA:0:7}-$(date +%s)"
# nomad job run -var="deployment_version=$DEPLOYMENT_VERSION" infra/nomad/portfolio.nomad.hcl
# env:
# NOMAD_ADDR: ${{ vars.NOMAD_ADDR }}
# NOMAD_TOKEN: ${{ secrets.NOMAD_TOKEN }}