Add a docker build step.
This commit is contained in:
parent
ff6837a751
commit
4ba9187b1d
10 changed files with 217 additions and 24 deletions
58
.forgejo/workflows/docker.yml
Normal file
58
.forgejo/workflows/docker.yml
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue