Skip to content

Commit

Permalink
install and cache npm dependencies, remove PROJECT
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-gilber committed Nov 4, 2023
1 parent c844136 commit dbca653
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

# Set Workflow-level environment variables
env:
PROJECT: demoapp-frontend

jobs:
unit-test:
# Run job when not triggered by a merge
Expand All @@ -40,6 +36,20 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout

# Cache NPM dependencies
- name: Cache NPM dependencies
id: cache
uses: actions/cache@v3 # https://github.com/marketplace/actions/cache#using-a-combination-of-restore-and-save-actions
with:
path: |
node_modules
key: npm-${{ hashFiles('package-lock.json') }}

# Install NPM dependencies
- name: Install NPM dependencies
run: npm ci

- name: Run tests
run: npm run test

Expand Down Expand Up @@ -86,7 +96,7 @@ jobs:
# Set Complete Container Image URL
- name: Set CONTAINER_IMAGE_URL
run: |
echo "CONTAINER_IMAGE_URL=${{ vars.DOCKER_REGISTRY_URL }}/${{ vars.DOCKER_REPOSITORY }}/${{ env.PROJECT }}:${{ env.CI_ACTION_REF_NAME }}" >> $GITHUB_ENV
echo "CONTAINER_IMAGE_URL=${{ vars.DOCKER_REGISTRY_URL }}/${{ vars.DOCKER_REPOSITORY }}/${{ env.CI_REPOSITORY_NAME }}:${{ env.CI_ACTION_REF_NAME }}" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
Expand Down Expand Up @@ -154,7 +164,7 @@ jobs:
# Set Complete Container Image URL
- name: Set CONTAINER_IMAGE_URL
run: |
echo "CONTAINER_IMAGE_URL=${{ vars.DOCKER_REGISTRY_URL }}/${{ vars.DOCKER_REPOSITORY }}/${{ env.PROJECT }}:${{ env.CI_ACTION_REF_NAME }}" >> $GITHUB_ENV
echo "CONTAINER_IMAGE_URL=${{ vars.DOCKER_REGISTRY_URL }}/${{ vars.DOCKER_REPOSITORY }}/${{ env.CI_REPOSITORY_NAME }}:${{ env.CI_ACTION_REF_NAME }}" >> $GITHUB_ENV
- name: Login to DockerHub
uses: docker/login-action@v3 # https://github.com/marketplace/actions/docker-login
Expand Down Expand Up @@ -224,7 +234,7 @@ jobs:
# Set Complete Container Image URL
- name: Set CONTAINER_IMAGE_URL
run: |
echo "CONTAINER_IMAGE_URL=${{ vars.DOCKER_REGISTRY_URL }}/${{ vars.DOCKER_REPOSITORY }}/${{ env.PROJECT }}:${{ env.CI_ACTION_REF_NAME }}" >> $GITHUB_ENV
echo "CONTAINER_IMAGE_URL=${{ vars.DOCKER_REGISTRY_URL }}/${{ vars.DOCKER_REPOSITORY }}/${{ env.CI_REPOSITORY_NAME }}:${{ env.CI_ACTION_REF_NAME }}" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4 # https://github.com/marketplace/actions/checkout
Expand Down

0 comments on commit dbca653

Please sign in to comment.