Skip to content

Commit

Permalink
Deseng 543 font awesome metweb cd (#2502)
Browse files Browse the repository at this point in the history
* Added fontawesome token in met-web cd and docker file

* Removed duplicate line

* updating FONTAWESOME_PACKAGE_TOKEN to get it from environment variable

* Updating the met-web cd files

* Set env variable
  • Loading branch information
ratheesh-aot authored May 10, 2024
1 parent e73f7db commit 2ca9a8d
Show file tree
Hide file tree
Showing 6 changed files with 215 additions and 243 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/met-web-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ env:
OPENSHIFT_SA_NAME: ${{ secrets.OPENSHIFT_SA_NAME }}
OPENSHIFT_IMAGE_REGISTRY: ${{ secrets.OPENSHIFT_IMAGE_REGISTRY }}
OPENSHIFT_REPOSITORY: ${{ secrets.OPENSHIFT_REPOSITORY }}
FONTAWESOME_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}

jobs:
met-web-cd:
Expand All @@ -52,7 +53,7 @@ jobs:
- name: Build image
run: |
docker build . --file Dockerfile --tag image
docker build . --file Dockerfile --build-arg FONTAWESOME_TOKEN=${{ env.FONTAWESOME_TOKEN}} --tag image
- name: Push image
run: |
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/met-web-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm config set '//npm.fontawesome.com/:_authToken' "${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}"
npm install --legacy-peer-deps
env:
FONTAWESOME_PACKAGE_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
- name: Lint
id: lint
run: |
Expand All @@ -62,8 +63,9 @@ jobs:

- name: Install dependencies
run: |
npm config set '//npm.fontawesome.com/:_authToken' "${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}"
npm install --legacy-peer-deps
env:
FONTAWESOME_PACKAGE_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}

- name: Test with jest
id: test
Expand Down Expand Up @@ -98,8 +100,9 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
npm config set '//npm.fontawesome.com/:_authToken' "${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}"
npm install --legacy-peer-deps
env:
FONTAWESOME_PACKAGE_TOKEN: ${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
- name: build to check strictness
id: build
run: |
Expand Down
1 change: 1 addition & 0 deletions met-web/.npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@fortawesome:registry=https://npm.fontawesome.com/
//npm.fontawesome.com/:_authToken=${FONTAWESOME_PACKAGE_TOKEN}
7 changes: 7 additions & 0 deletions met-web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# Argument for the FontAwesome token
ARG FONTAWESOME_TOKEN

# Set FontAwesome token as an environment variable for use in the .npmrc
ENV FONTAWESOME_PACKAGE_TOKEN=${FONTAWESOME_TOKEN}

# install app dependencies
COPY package.json ./
COPY package-lock.json ./
COPY .npmrc ./

RUN npm install --silent
RUN npm install [email protected] -g --silent
Expand Down
2 changes: 1 addition & 1 deletion met-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ React.js frontend application for The Modern Engagement Tool project.
* Install the following:
- [Node.js](https://nodejs.org/en/)
* Install Dependencies
- Set token for fontawesome by running `npm config set '//npm.fontawesome.com/:_authToken' "FONTAWESOME_PACKAGE_TOKEN"`
- Set env variable `FONTAWESOME_PACKAGE_TOKEN` in your system
- Run `npm install` in the root of the project (met-web)

## Environment Variables
Expand Down
Loading

0 comments on commit 2ca9a8d

Please sign in to comment.