mirror of
https://github.com/frappe/frappe_docker.git
synced 2025-02-10 16:08:40 +00:00
build: Change bench target names and move CI to separate workflow (#655)
* Change bench target names and move CI to separate workflow * Fix file detection
This commit is contained in:
parent
b02191f3f8
commit
05853825d8
46
.github/workflows/build_bench.yml
vendored
Normal file
46
.github/workflows/build_bench.yml
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
name: Bench
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- build/bench/**
|
||||
- docker-bake.hcl
|
||||
|
||||
schedule:
|
||||
# Every day at 12:00 pm
|
||||
- cron: 0 0 * * *
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build and test
|
||||
uses: docker/bake-action@v1.6.0
|
||||
with:
|
||||
files: docker-bake.hcl
|
||||
targets: bench-test
|
||||
|
||||
- name: Login
|
||||
if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Push
|
||||
if: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
|
||||
uses: docker/bake-action@v1.6.0
|
||||
with:
|
||||
targets: bench
|
||||
files: docker-bake.hcl
|
||||
push: true
|
33
.github/workflows/build_develop.yml
vendored
33
.github/workflows/build_develop.yml
vendored
@ -23,38 +23,7 @@ env:
|
||||
IS_AUTHORIZED_RUN: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
build_bench:
|
||||
name: Bench
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Login
|
||||
uses: docker/login-action@v1
|
||||
if: env.IS_AUTHORIZED_RUN == 'true'
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and test
|
||||
uses: docker/bake-action@v1.6.0
|
||||
with:
|
||||
files: docker-bake.hcl
|
||||
targets: bench-test
|
||||
|
||||
- name: Push
|
||||
uses: docker/bake-action@v1.6.0
|
||||
if: env.IS_AUTHORIZED_RUN == 'true'
|
||||
with:
|
||||
files: docker-bake.hcl
|
||||
targets: bench-build
|
||||
push: true
|
||||
|
||||
build_main:
|
||||
build:
|
||||
name: Frappe & ERPNext
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM debian:bullseye-slim as build
|
||||
FROM debian:bullseye-slim as bench
|
||||
|
||||
LABEL author=frappé
|
||||
|
||||
@ -125,7 +125,7 @@ RUN wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh |
|
||||
|
||||
EXPOSE 8000-8005 9000-9005 6787
|
||||
|
||||
FROM build as test
|
||||
FROM bench as bench-test
|
||||
|
||||
# Print version and verify bashrc is properly sourced so that everything works
|
||||
# in the interactive shell and Dockerfile
|
||||
|
@ -2,17 +2,17 @@
|
||||
# Reference: https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md
|
||||
|
||||
|
||||
# Bench images
|
||||
# Bench image
|
||||
|
||||
target "bench-build" {
|
||||
target "bench" {
|
||||
context = "build/bench"
|
||||
target = "bench"
|
||||
tags = ["frappe/bench:latest"]
|
||||
dockerfile = "build/bench/Dockerfile"
|
||||
target = "build"
|
||||
}
|
||||
|
||||
target "bench-test" {
|
||||
inherits = ["bench-build"]
|
||||
target = "test"
|
||||
inherits = ["bench"]
|
||||
target = "bench-test"
|
||||
}
|
||||
|
||||
# Main images
|
||||
|
Loading…
x
Reference in New Issue
Block a user