Skip to content

Commit

Permalink
ci: updated actions and improved performance (#1582)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSlimvReal authored Dec 10, 2022
1 parent 649b9a2 commit 9723a11
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/master-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ jobs:
GIT_BRANCH=master
GIT_COMMITTED_AT=${{ env.TIME }}
CC_TEST_REPORTER_ID=${{ secrets.CODE_CLIMATE_ID }}
cache-from: type=registry,ref=aamdigital/ndb-server:cache
cache-to: type=registry,ref=aamdigital/ndb-server:cache,mode=max
cache-from: type=gha
cache-to: type=gha,mode=max
check-dependencies:
runs-on: ubuntu-latest
steps:
Expand All @@ -62,7 +62,7 @@ jobs:
with:
args: --sarif-file-output=snyk.sarif
- name: Upload result to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: snyk.sarif
run-e2e-tests:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/pull-request-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: docker/setup-buildx-action@v2
- name: Get time of commit
run: echo "TIME=$(git log -1 --pretty=format:%ct)" >> $GITHUB_ENV
- name: Build dev image and save it locally
- name: Run tests in Docker image
uses: docker/build-push-action@v3
with:
context: ./
Expand All @@ -25,7 +25,9 @@ jobs:
GIT_BRANCH=${{ github.head_ref }}
GIT_COMMITTED_AT=${{ env.TIME }}
CC_TEST_REPORTER_ID=${{ secrets.CODE_CLIMATE_ID }}
cache-from: type=registry,ref=aamdigital/ndb-server:cache
BUILD=${{ false }}
cache-from: type=gha
cache-to: type=gha,mode=max
deploy-prod-image:
runs-on: ubuntu-latest
steps:
Expand All @@ -46,7 +48,8 @@ jobs:
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: aamdigital/ndb-server:pr-${{ github.event.number }}
cache-from: type=registry,ref=aamdigital/ndb-server:cache
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy updated image
uses: appleboy/ssh-action@master
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tagged-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: aamdigital/ndb-server:${{ env.TAG }}
cache-from: type=registry,ref=aamdigital/ndb-server:cache
cache-to: type=registry,ref=aamdigital/ndb-server:cache,mode=max
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
APP_VERSION=${{ env.TAG }}
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_TOKEN }}
Expand Down
9 changes: 6 additions & 3 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ COPY . .
ARG APP_VERSION="UNKNOWN"
RUN sed -i "s/appVersion: \".*\"/appVersion: \"$APP_VERSION\"/g" src/environments/environment*.ts

# Transform the xliff files to json so this does not have to be done on the client side
RUN node build/prepare-translation-files.js

RUN npm run build
# When set to false, no production build for the app is done
ARG BUILD=true
RUN if [ "$BUILD" = true ] ; then \
node build/prepare-translation-files.js &&\
npm run build ; fi


# When set to true, tests are run and coverage will be uploaded to CodeClimate
ARG UPLOAD_COVERAGE=false
Expand Down

0 comments on commit 9723a11

Please sign in to comment.