Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHARED(Docs): Add new section for installation instructions #38

Merged
merged 5 commits into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/shared_frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- "!**/*.md"
env:
FRONTEND_DIR: ./frontend
GITHUB_REGISTRY_TOKEN: ${{ secrets.GITHUB_TOKEN }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ dist
!**/.yarn/plugins
!**/.yarn/releases
!**/.yarn/sdks
!**/.yarn/versions
!**/.yarn/versions
2 changes: 2 additions & 0 deletions docker-compose-akt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ services:
build:
context: ./frontend
dockerfile: Dockerfile.akt
args:
- GITHUB_REGISTRY_TOKEN=${GITHUB_REGISTRY_TOKEN}
ports:
- "4000:4000"
working_dir: /app/reactjs
Expand Down
2 changes: 2 additions & 0 deletions docker-compose-otr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ services:
build:
context: ./frontend
dockerfile: Dockerfile.otr
args:
- GITHUB_REGISTRY_TOKEN=${GITHUB_REGISTRY_TOKEN}
ports:
- "4000:4000"
working_dir: /app/reactjs
Expand Down
18 changes: 18 additions & 0 deletions docs/shared_frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,21 @@ In this project directory, you can run:
│ └── styles # SCSS styles
│ └── utils # Utils
└── ...

## How to install the package?

1. Create an access token as instructed [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token), and select ONLY `read:packages` as the scope
2. Add created token to your bash profile:

```sh
PROFILE_ADDRESS=~/.zshrc # Depends on your current active profile. ~/.zshrc or ~/.bashrc
echo 'export GITHUB_REGISTRY_TOKEN="created_token_here"' >> $PROFILE_ADDRESS
```

3. Reload bash profile configs

```sh
source $PROFILE_ADDRESS
```

4. Run `yarn add @opetushallitus/kieli-ja-kaantajatutkinnot.shared@version` to install the package
4 changes: 3 additions & 1 deletion frontend/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ enableTelemetry: false
nodeLinker: node-modules

npmScopes:
"@opetushallitus":
"opetushallitus":
npmRegistryServer: "https://npm.pkg.github.com"
npmAlwaysAuth: true
npmAuthToken: ${GITHUB_REGISTRY_TOKEN}

yarnPath: .yarn/releases/yarn-3.2.0.cjs
2 changes: 2 additions & 0 deletions frontend/Dockerfile.akt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM node:16.14.2-alpine

RUN corepack enable

ARG GITHUB_REGISTRY_TOKEN

# Create app directory
WORKDIR /app/reactjs

Expand Down
2 changes: 2 additions & 0 deletions frontend/Dockerfile.otr
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM node:16.14.2-alpine

RUN corepack enable

ARG GITHUB_REGISTRY_TOKEN

# Create app directory
WORKDIR /app/reactjs

Expand Down
8 changes: 7 additions & 1 deletion frontend/packages/shared/CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Released]

## [1.0.3] - 2022-05-09

### Added

- Installation instructions

## [1.0.2] - 2022-05-09

### Fixed
Expand All @@ -19,7 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

- missing style imports on shared components
- Missing style imports on shared components

### Changed

Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opetushallitus/kieli-ja-kaantajatutkinnot.shared",
"version": "1.0.2",
"version": "1.0.3",
"description": "Shared Frontend Package",
"exports": {
"./components": "./src/components/index.tsx",
Expand Down