2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-08 22:31:07 +00:00
frappe_docker/.github/workflows/build_develop.yml

115 lines
2.6 KiB
YAML
Raw Normal View History

name: Build Develop
on:
pull_request:
branches:
- main
paths:
- .github/workflows/build_develop.yml
- build/**
- installation/**
- tests/**
- .dockerignore
- docker-bake.hcl
- env-example
schedule:
2021-11-04 12:31:49 +00:00
# Every day at 12:00 pm
- cron: 0 0 * * *
workflow_dispatch:
2021-11-04 12:31:49 +00:00
env:
IS_AUTHORIZED_RUN: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }}
jobs:
build_bench:
2021-11-04 12:31:49 +00:00
name: Bench
runs-on: ubuntu-latest
steps:
2021-11-04 12:31:49 +00:00
- name: Checkout
uses: actions/checkout@v2
- name: Setup Buildx
uses: docker/setup-buildx-action@v1
2021-11-04 12:31:49 +00:00
- name: Login
uses: docker/login-action@v1
if: env.IS_AUTHORIZED_RUN == 'true'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
2021-11-04 12:31:49 +00:00
- name: Build and test
uses: docker/bake-action@v1.6.0
with:
files: docker-bake.hcl
2021-11-04 12:31:49 +00:00
targets: bench-test
- name: Push
uses: docker/bake-action@v1.6.0
if: env.IS_AUTHORIZED_RUN == 'true'
2021-11-04 12:31:49 +00:00
with:
files: docker-bake.hcl
targets: bench-build
push: true
build_main:
name: Frappe & ERPNext
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
2021-11-04 12:31:49 +00:00
- name: Checkout
uses: actions/checkout@v2
2021-11-04 12:31:49 +00:00
- name: Setup Buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host
2021-11-04 12:31:49 +00:00
- name: Login
uses: docker/login-action@v1
if: env.IS_AUTHORIZED_RUN == 'true'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Frappe
uses: docker/bake-action@v1.6.0
with:
files: docker-bake.hcl
2021-11-04 12:31:49 +00:00
targets: frappe-develop-test
load: true
- name: Push Frappe to local registry
uses: docker/bake-action@v1.6.0
with:
files: docker-bake.hcl
targets: frappe-develop-test-local
push: true
- name: Test Frappe
run: ./tests/test-frappe.sh
- name: Build ERPNext
uses: docker/bake-action@v1.6.0
with:
files: docker-bake.hcl
2021-11-04 12:31:49 +00:00
targets: erpnext-develop-test
load: true
- name: Test ERPNext
run: ./tests/test-erpnext.sh
2021-11-04 12:31:49 +00:00
- name: Push
if: env.IS_AUTHORIZED_RUN == 'true'
uses: docker/bake-action@v1.6.0
with:
files: docker-bake.hcl
targets: frappe-develop,erpnext-develop
push: true