58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
name: Docker Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, docker ]
|
|
|
|
jobs:
|
|
docker-backend:
|
|
name: Build and Push Backend Image
|
|
runs-on: docker
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Forgejo Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ forgejo.server_url }}
|
|
username: ${{ forgejo.actor }}
|
|
password: ${{ secrets.FORGEJO_TOKEN }}
|
|
|
|
- name: Build and push image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./backend
|
|
push: true
|
|
tags: drew/captains-log-backend
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
|
|
docker-frontend:
|
|
name: Build and Push Frontend Image
|
|
runs-on: docker
|
|
steps:
|
|
- name: Checkout Repo
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Forgejo Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ forgejo.server_url }}
|
|
username: ${{ forgejo.actor }}
|
|
password: ${{ secrets.FORGEJO_TOKEN }}
|
|
|
|
- name: Build and push image
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ./frontend
|
|
push: true
|
|
tags: drew/captains-log-frontend
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|