Liam Pietralla
f577617b4d
All checks were successful
Build and Publish / Build Yale Access Backend (push) Successful in 28s
Build and Publish / Build Yale Access Frontend (push) Successful in 47s
Build and Publish / Push Yale Access Backend Docker Image (push) Successful in 9s
Build and Publish / Push Yale Access Frontend Docker Image (push) Successful in 10s
134 lines
3.4 KiB
YAML
134 lines
3.4 KiB
YAML
name: Build and Publish
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- feature/*
|
|
- fix/*
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-backend:
|
|
name: Build Yale Access Backend
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./packages/backend
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: 7.0.x
|
|
|
|
- name: Restore dependencies
|
|
run: dotnet restore
|
|
|
|
- name: Build
|
|
run: dotnet build --configuration Release --no-restore
|
|
|
|
publish-backend:
|
|
name: Push Yale Access Backend Docker Image
|
|
runs-on: ubuntu-latest
|
|
needs: build-backend
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Docker Metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: liamsgit.dev/LiamPietralla/yale-user-access-backend
|
|
tags: |
|
|
type=raw,value=latest
|
|
labels: |
|
|
org.opencontainers.image.title=Yale Access Backend
|
|
org.opencontainers.image.description=Backend for Yale Access
|
|
|
|
- name: Login to Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: liamsgit.dev
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
context: ./packages/backend
|
|
file: ./packages/backend/Dockerfile
|
|
|
|
build-frontend:
|
|
name: Build Yale Access Frontend
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: ./packages/frontend
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: 20.x
|
|
|
|
- name: Setup Yarn
|
|
run: npm install -g yarn
|
|
|
|
- name: Install dependencies
|
|
run: yarn install
|
|
|
|
- name: Build
|
|
run: yarn run build
|
|
|
|
publish-frontend:
|
|
name: Push Yale Access Frontend Docker Image
|
|
runs-on: ubuntu-latest
|
|
needs: build-frontend
|
|
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Docker Metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v4
|
|
with:
|
|
images: liamsgit.dev/LiamPietralla/yale-user-access-frontend
|
|
tags: |
|
|
type=raw,value=latest
|
|
labels: |
|
|
org.opencontainers.image.title=Yale Access Frontend
|
|
org.opencontainers.image.description=Frontend for Yale Access
|
|
|
|
- name: Login to Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: liamsgit.dev
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v4
|
|
with:
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
context: ./packages/frontend
|
|
file: ./packages/frontend/Dockerfile
|