Skip to content

Commit 0f2ac35

Browse files
author
Ivica Matic
committed
docs: added documentation
1 parent ddd9de5 commit 0f2ac35

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.github/workflows/build-dist-version-on-release.yaml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,28 +25,25 @@ jobs:
2525

2626
build-distribution-version-into-docker-container:
2727
runs-on: ubuntu-latest
28+
# environment: environment_name # use if you want to use a specific environment on repository level
2829
steps:
29-
- uses: actions/checkout@v4
30-
name: Checkout repository
31-
3230
- name: Check if secrets exist
3331
run: |
3432
if [[ -z "${{ secrets.DOCKER_LOGIN_SERVER }}" || -z "${{ secrets.DOCKER_USERNAME }}" || -z "${{ secrets.DOCKER_PASSWORD }}" ]]; then
3533
echo "Error: Secrets not found."
3634
exit 1
3735
fi
38-
36+
- uses: actions/checkout@v4
37+
name: Checkout repository
3938
- uses: docker/login-action@v2
4039
name: Log in to the Container registry
4140
with:
4241
registry: ${{ secrets.DOCKER_LOGIN_SERVER}}
4342
username: ${{ secrets.DOCKER_USERNAME }}
4443
password: ${{ secrets.DOCKER_PASSWORD }}
45-
4644
- uses: docker/setup-buildx-action@v2
4745
name: Set up Docker Buildx
4846
id: buildx
49-
5047
- uses: docker/build-push-action@v4
5148
name: Build and push Docker image
5249
with:

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# Github actions Node 20 react app build template
2+
This is a template repoistory set up that it builds react spa application using github actions on every new release. The build is done on ubuntu-latest runner and uses node 20. The build is done using `npm ci` and `npm run build`. In addition to saving the built output to artifact, 2nd job builds the static html/css/js and pushes it to the nginx container togather with nginx config for spa so that it can be
3+
hosted using anything that can run a docker container.
4+
5+
## Requirements for docker container build
6+
You need to have the following secrets set up in your github either on organization or repository level. If you are using repository level secrets with environments, uncomment the `environment` section in the github workflow file and replace it with the name of your environment.
7+
8+
| Secret Name | Description |
9+
| ----------- | ----------- |
10+
| DOCKER_LOGIN_SERVER | The server URL of the docker registry.|
11+
| DOCKER_USERNAME | The username to login to the docker registry.|
12+
| DOCKER_PASSWORD | The password to login to the docker registry.|
13+
114
# Getting Started with Create React App
215

316
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

0 commit comments

Comments
 (0)