ci(frontend): optimizing build for caching
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
parent
bdc3fcf22b
commit
e975c07482
1 changed files with 11 additions and 1 deletions
12
.github/workflows/frontend.yaml
vendored
12
.github/workflows/frontend.yaml
vendored
|
|
@ -18,6 +18,15 @@ jobs:
|
|||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.OS }}-build-
|
||||
${{ runner.OS }}-
|
||||
|
||||
- name: Docker login
|
||||
run: |
|
||||
docker login ${{ secrets.EE_REGISTRY_URL }} -u ${{ secrets.EE_DOCKER_USERNAME }} -p "${{ secrets.EE_REGISTRY_TOKEN }}"
|
||||
|
|
@ -43,7 +52,8 @@ jobs:
|
|||
ENVIRONMENT: staging
|
||||
run: |
|
||||
cd frontend
|
||||
PUSH_IMAGE=1 bash build.sh
|
||||
docker run --rm -v /etc/passwd:/etc/passwd -u `id -u`:`id -g` -v $(pwd):/home/${USER} -w /home/${USER} --name node_build node:14-stretch-slim /bin/bash -c "npm install && npm run build:oss"
|
||||
docker push $DOCKER_REPO/frontend:${IMAGE_TAG}
|
||||
- name: Creating old image input
|
||||
run: |
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue