From adbef2ed60b4b490309c1ca6df0aa075df5607de Mon Sep 17 00:00:00 2001 From: Toxix Date: Mon, 5 Jul 2021 02:32:31 +0200 Subject: [PATCH] Feat adjust github pipeline for docker frontend artifacts This should allow to use docker building the frontend artifacts and reusing them in the bare metal release. --- .github/workflows/ci.yml | 51 +++++++++++++--------------------------- 1 file changed, 16 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69fac022e..4b45f7bc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,35 +144,8 @@ jobs: cd src/ coveralls --service=github - frontend: - runs-on: ubuntu-20.04 - steps: - - - name: Checkout - uses: actions/checkout@v2 - - - uses: actions/setup-node@v2 - with: - node-version: '15' - - - name: Configure version on dev branches - if: startsWith(github.ref, 'refs/heads/feature-') || github.ref == 'refs/heads/dev' - run: | - git_hash=$(git rev-parse --short "$GITHUB_SHA") - git_branch=${GITHUB_REF#refs/heads/} - sed -i -E "s/version: \"(.*)\"/version: \"${git_branch} ${git_hash}\"/g" src-ui/src/environments/environment.prod.ts - - - name: Build frontend - run: ./compile-frontend.sh - - - name: Upload artifact - uses: actions/upload-artifact@v2 - with: - name: frontend-compiled - path: src/documents/static/frontend/ - build-release: - needs: [frontend, documentation, tests, whitespace, codestyle] + needs: [build-docker-image, documentation, tests, whitespace, codestyle] runs-on: ubuntu-20.04 steps: - @@ -183,6 +156,10 @@ jobs: uses: actions/setup-python@v2 with: python-version: 3.7 + - + uses: actions/setup-node@v2 + with: + node-version: '15' - name: Install dependencies run: | @@ -282,7 +259,7 @@ jobs: build-docker-image: if: github.event_name == 'push' && (startsWith(github.ref, 'refs/heads/feature-') || github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/ng-')) runs-on: ubuntu-latest - needs: [frontend, tests, whitespace, codestyle] + needs: [tests, whitespace, codestyle] steps: - name: Prepare @@ -303,12 +280,6 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - - name: Download frontend artifact - uses: actions/download-artifact@v2 - with: - name: frontend-compiled - path: src/documents/static/frontend/ - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 @@ -344,3 +315,13 @@ jobs: name: Inspect image run: | docker buildx imagetools inspect ${{ steps.prepare.outputs.inspect_tag }} + - + name: Export frontend artifact from docker + run: | + docker cp ${{ steps.prepare.outputs.tags }}:/src/src/documents/static/frontend/ src/documents/static/frontend/ + - + name: Upload frontend artifact + uses: actions/upload-artifact@v2 + with: + name: frontend-compiled + path: src/documents/static/frontend/