build and push container with forgejo actions
This commit is contained in:
parent
8c7fb8c6bf
commit
91368f5c8e
6 changed files with 65 additions and 34 deletions
39
.forgejo/workflows/build-and-push-containers.yaml
Normal file
39
.forgejo/workflows/build-and-push-containers.yaml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:22-bullseye
|
||||
|
||||
steps:
|
||||
- name: Install Docker
|
||||
run: |
|
||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||
sh get-docker.sh
|
||||
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to forgejo
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: forgejo.fredzernia.com
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.PACKAGE_TOKEN }}
|
||||
|
||||
- name: build and push backend
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: backend/.
|
||||
push: true
|
||||
tags: forgejo.fredzernia.com/${{ env.FORGEJO_REPOSITORY }}_backend:latest
|
||||
|
||||
- name: build and push frontend
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: frontend/.
|
||||
push: true
|
||||
tags: forgejo.fredzernia.com/${{ env.FORGEJO_REPOSITORY }}_frontend:latest
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
NODE_ENV: dev
|
||||
container:
|
||||
image: node:22-bullseye
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build Frontend
|
||||
working-directory: frontend
|
||||
run: |
|
||||
npm ci
|
||||
npm run ci
|
||||
|
||||
- name: Build Backend
|
||||
working-directory: backend
|
||||
run: |
|
||||
npm ci
|
||||
npm run ci
|
||||
Loading…
Add table
Add a link
Reference in a new issue