-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ec8bcc
commit e0d23c8
Showing
12 changed files
with
462 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Continuous integration | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
jobs: | ||
build-test: | ||
name: Build and test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: package.json | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn install --immutable --immutable-cache --check-cache | ||
|
||
- name: Run tests | ||
run: yarn test --passWithNoTests | ||
|
||
- name: Build | ||
run: yarn run build | ||
|
||
eslint: | ||
name: ESLint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
permissions: | ||
security-events: write | ||
actions: read | ||
contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: package.json | ||
cache: yarn | ||
|
||
- name: Install dependencies | ||
run: yarn install --immutable --immutable-cache --check-cache | ||
|
||
- name: Run ESLint | ||
run: yarn run lint:sarif | ||
continue-on-error: true | ||
|
||
- name: Upload ESLint analysis results to GitHub | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: eslint-results.sarif | ||
wait-for-processing: true | ||
category: ESLint | ||
|
||
validate-docker-build: | ||
name: Validate if docker image builds | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build & tag docker image | ||
uses: AplinkosMinisterija/reusable-workflows/.github/actions/docker-build-tag-push@main | ||
with: | ||
environment: test | ||
push: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Deploy to Development | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy-development: | ||
name: Deploy development | ||
uses: AplinkosMinisterija/reusable-workflows/.github/workflows/biip-deploy.yml@main | ||
secrets: inherit | ||
permissions: | ||
contents: read | ||
packages: write | ||
with: | ||
environment: Development | ||
docker-image: ghcr.io/AplinkosMinisterija/biip-waste-calculator-web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Deploy to Production | ||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
deploy-production: | ||
name: Deploy production | ||
uses: AplinkosMinisterija/reusable-workflows/.github/workflows/biip-deploy.yml@main | ||
secrets: inherit | ||
permissions: | ||
contents: read | ||
packages: write | ||
with: | ||
environment: Production | ||
docker-image: ghcr.io/AplinkosMinisterija/biip-waste-calculator-web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Deploy to Staging | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
deploy-staging: | ||
name: Deploy staging | ||
uses: AplinkosMinisterija/reusable-workflows/.github/workflows/biip-deploy.yml@main | ||
secrets: inherit | ||
permissions: | ||
contents: read | ||
packages: write | ||
with: | ||
environment: Staging | ||
docker-image: ghcr.io/AplinkosMinisterija/biip-waste-calculator-web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Contributing | ||
|
||
Thank you for considering contributing to this repository! We welcome any contributions that can | ||
help make this project better. | ||
|
||
## Submitting a pull request | ||
|
||
1. Fork the repository to your own GitHub account | ||
2. Create a new branch with a descriptive name for your contribution | ||
3. Make your changes in the branch | ||
4. Push to your fork | ||
5. Test your changes thoroughly to ensure they are functional and do not introduce any new issues | ||
6. Submit a pull request, detailing the changes you have made and the rationale behind them | ||
|
||
## Resources | ||
|
||
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) | ||
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) | ||
- [GitHub Help](https://help.github.com) | ||
- [Writing good commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
FROM node:20-alpine as build | ||
|
||
# Working directory | ||
WORKDIR /app | ||
|
||
# Install dependencies | ||
COPY package.json yarn.lock ./ | ||
RUN yarn install --frozen-lockfile | ||
|
||
# Copy source | ||
COPY . . | ||
|
||
# Build and cleanup | ||
RUN yarn build | ||
|
||
# Caddy stage | ||
FROM caddy:2.6-alpine | ||
|
||
# Set default NODE_ENV | ||
ENV NODE_ENV=production | ||
|
||
# Expose port | ||
EXPOSE 80 | ||
|
||
# Healthcheck | ||
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD wget -qO- http://localhost/ || exit 1 | ||
|
||
# Copy Caddyfile | ||
COPY ./caddy/Caddyfile /etc/caddy/Caddyfile | ||
|
||
# Copy built files from the build stage | ||
COPY --from=build /app/build /srv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,91 @@ | ||
# Getting Started with Create React App | ||
# BĮIP XXXXXX WEB | ||
|
||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | ||
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/AplinkosMinisterija/biip-zuvinimas-web/badge)](https://securityscorecards.dev/viewer/?platform=github.com&org={AplinkosMinisterija}&repo={biip-zuvinimas-web}) | ||
[![License](https://img.shields.io/github/license/AplinkosMinisterija/biip-zuvinimas-web)](https://github.com/AplinkosMinisterija/biip-zuvinimas-web/blob/main/LICENSE) | ||
[![GitHub issues](https://img.shields.io/github/issues/AplinkosMinisterija/biip-zuvinimas-web)](https://github.com/AplinkosMinisterija/biip-zuvinimas-web/issues) | ||
[![GitHub stars](https://img.shields.io/github/stars/AplinkosMinisterija/biip-zuvinimas-web)](https://github.com/AplinkosMinisterija/biip-zuvinimas-web/stargazers) | ||
|
||
## Available Scripts | ||
This repository contains the source code and documentation for the BĮIP Žuvinimas WEB, developed by the Aplinkos | ||
Ministerija. | ||
|
||
In the project directory, you can run: | ||
## Table of Contents | ||
|
||
### `npm start` | ||
- [About the Project](#about-the-project) | ||
- [Getting Started](#getting-started) | ||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [Deployment](#deployment) | ||
- [Contributing](#contributing) | ||
- [License](#license) | ||
|
||
Runs the app in the development mode.\ | ||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. | ||
## About the Project | ||
|
||
The page will reload if you make edits.\ | ||
You will also see any lint errors in the console. | ||
The BĮIP Žuvinimas WEB is designed to provide information and functionalities related to fish stocking activities. It | ||
aims to support the management and conservation of fish populations, as well as the sustainability of fishing practices. | ||
|
||
### `npm test` | ||
This is a client application that utilizes | ||
the [BĮIP Žuvinimas API](https://github.com/AplinkosMinisterija/biip-zuvinimas-api). | ||
|
||
Launches the test runner in the interactive watch mode.\ | ||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | ||
Key features of the WEB include: | ||
|
||
### `npm run build` | ||
- Retrieving fish stocking data, such as planned fish stockings and historical information. | ||
- Managing fish stocking data. | ||
|
||
Builds the app for production to the `build` folder.\ | ||
It correctly bundles React in production mode and optimizes the build for the best performance. | ||
## Getting Started | ||
|
||
The build is minified and the filenames include the hashes.\ | ||
Your app is ready to be deployed! | ||
To get started with the BĮIP Žuvinimas WEB, follow the instructions below. | ||
|
||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | ||
### Installation | ||
|
||
### `npm run eject` | ||
1. Clone the repository: | ||
|
||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!** | ||
```bash | ||
git clone https://github.com/AplinkosMinisterija/biip-zuvinimas-web.git | ||
``` | ||
|
||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. | ||
2. Install the required dependencies: | ||
|
||
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. | ||
```bash | ||
cd biip-zuvinimas-web | ||
yarn install | ||
``` | ||
|
||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. | ||
### Usage | ||
|
||
## Learn More | ||
1. Start the WEB server: | ||
|
||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). | ||
```bash | ||
yarn start | ||
``` | ||
|
||
To learn React, check out the [React documentation](https://reactjs.org/). | ||
The WEB will be available at `http://localhost:8080`. | ||
|
||
## Deployment | ||
|
||
### Production | ||
|
||
To deploy the application to the production environment, create a new GitHub release: | ||
|
||
1. Go to the repository's main page on GitHub. | ||
2. Click on the "Releases" tab. | ||
3. Click on the "Create a new release" button. | ||
4. Provide a version number, such as `1.2.3`, and other relevant information. | ||
5. Click on the "Publish release" button. | ||
|
||
### Staging | ||
|
||
The `main` branch of the repository is automatically deployed to the staging environment. Any changes pushed to the main | ||
branch will trigger a new deployment. | ||
|
||
### Development | ||
|
||
To deploy any branch to the development environment use the `Deploy to Development` GitHub action. | ||
|
||
## Contributing | ||
|
||
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a | ||
pull request. For more information, see the [contribution guidelines](./CONTRIBUTING.md). | ||
|
||
## License | ||
|
||
This project is licensed under the [MIT License](./LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Security Policy | ||
|
||
This repository is committed to ensuring the security of its code and the protection of its users' | ||
data. We take security concerns seriously and strive to address them as quickly as possible. | ||
|
||
## Reporting a Vulnerability | ||
|
||
If you discover a security vulnerability in this repository, please notify us by | ||
using [private vulnerability reporting](https://docs.github.com/en/code-security/security-advisories/guidance-on-reporting-and-writing/privately-reporting-a-security-vulnerability). | ||
Please do not create a public issue, as doing so could potentially put the security of the repository and its users at | ||
risk. | ||
|
||
Please do not create a public issue, as this could potentially put the security of | ||
the repository and its users at risk. | ||
|
||
When reporting a vulnerability, please provide us with as much detail as possible, including: | ||
|
||
- A description of the vulnerability | ||
- Steps to reproduce the vulnerability | ||
- Any potential impact of the vulnerability | ||
- Your contact information, so we can follow up with you regarding the issue | ||
|
||
We will investigate all reported vulnerabilities and provide updates as we work to address them. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
:80 { | ||
root * /srv | ||
encode gzip | ||
|
||
try_files {path} {file} /index.html | ||
file_server | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.