name: Build Stable on: pull_request: branches: - main paths: - .github/workflows/build_stable.yml - .github/scripts/get-latest-tags.sh - build/** - installation/** - tests/** - .dockerignore - docker-bake.hcl - env-example push: branches: - main paths: - .github/workflows/build_stable.yml - .github/scripts/get-latest-tags.sh - build/** - installation/** - tests/** - .dockerignore - docker-bake.hcl - env-example # Triggered from frappe/frappe and frappe/erpnext on releases repository_dispatch: workflow_dispatch: env: IS_AUTHORIZED_RUN: ${{ github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' }} jobs: build: name: Frappe & ERPNext runs-on: ubuntu-latest strategy: matrix: version: [12, 13] services: registry: image: registry:2 ports: - 5000:5000 steps: - name: Checkout uses: actions/checkout@v2 - name: Setup Buildx uses: docker/setup-buildx-action@v1 with: driver-opts: network=host - name: Login uses: docker/login-action@v1 if: env.IS_AUTHORIZED_RUN == 'true' with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Get latest versions run: ./.github/scripts/get-latest-tags.sh env: VERSION: ${{ matrix.version }} - name: Build Frappe uses: docker/bake-action@v1.7.0 with: files: docker-bake.hcl targets: frappe-stable-test load: true - name: Push Frappe to local registry uses: docker/bake-action@v1.7.0 with: files: docker-bake.hcl targets: frappe-stable-test-local push: true - name: Test Frappe if: github.event_name == 'pull_request' run: ./tests/test-frappe.sh - name: Build ERPNext uses: docker/bake-action@v1.7.0 with: files: docker-bake.hcl targets: erpnext-stable-test load: true - name: Test ERPNext if: github.event_name == 'pull_request' run: ./tests/test-erpnext.sh - name: Push Frappe if: env.IS_AUTHORIZED_RUN == 'true' uses: docker/bake-action@v1.7.0 with: files: docker-bake.hcl targets: frappe-stable push: true env: GIT_TAG: ${{ env.FRAPPE_VERSION }} - name: Push ERPNext if: env.IS_AUTHORIZED_RUN == 'true' uses: docker/bake-action@v1.7.0 with: files: docker-bake.hcl targets: erpnext-stable push: true env: GIT_TAG: ${{ env.ERPNEXT_VERSION }} release_helm: name: Release Helm runs-on: ubuntu-latest if: github.repository == 'frappe/frappe_docker' && github.event_name != 'pull_request' needs: build steps: - name: Setup deploy key uses: webfactory/ssh-agent@v0.5.4 with: ssh-private-key: ${{ secrets.HELM_DEPLOY_KEY }} - name: Setup Git Credentials run: | git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --global user.name "github-actions[bot]" - name: Release run: | git clone git@github.com:frappe/helm.git && cd helm pip install -r release_wizard/requirements.txt ./release_wizard/wizard 13 patch --remote origin --ci