-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
4 changed files
with
76 additions
and
1 deletion.
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,31 @@ | ||
|
||
name: Build NodeJS container | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
|
||
jobs: | ||
build_container: | ||
name: Build NodeJS container | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Login to GitHub Packages Docker Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: devops-podkrepi-bg | ||
password: ${{ secrets.DEVOPS_PACKAGES_TOKEN }} | ||
|
||
- name: Get tag | ||
id: vars | ||
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: nodejs | ||
push: true | ||
tags: ghcr.io/podkrepi-bg/nodejs-devcontainer:${{ steps.vars.outputs.tag }} |
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
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 @@ | ||
FROM node:16.9-alpine3.14 | ||
|
||
RUN apk --no-cache add curl git zsh sudo docker-cli docker-compose | ||
|
||
ENV TERM xterm | ||
ENV SHELL /bin/zsh | ||
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true |
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,37 @@ | ||
# Setup for NodeJS development | ||
Currently, all modules within Podkrepi.bg are built using NodeJS 16. [Yarn](https://yarnpkg.com/) is used as a package manager. | ||
|
||
- [Visual Studio Code setup](#visual-studio-code-setup) | ||
- [Github Workflows](#github-workflows) | ||
|
||
## Visual Studio Code setup | ||
The easiest way to start developing NodeJS modules for Podkrepi.bg is by using [Visual Studio Code](https://code.visualstudio.com/download). Make sure the [Remote Containers extension](https://code.visualstudio.com/docs/remote/containers) is installed. It provides an easy way to configure a container as a [development environment](https://code.visualstudio.com/docs/remote/containers). This can be done by adding a `.devcontainer/devcontainer.json` to the root of the workspace. In most cases, it is sufficient to copy the contents of this example: | ||
|
||
```json | ||
{ | ||
"name": "NodeJS", | ||
"image": "ghcr.io/podkrepi-bg/nodejs-devcontainer:v1.1.0", | ||
"forwardPorts": [], // Forward ports | ||
"containerEnv": { | ||
"DATABASE_URL": "postgres://postgres:[email protected]:5432/postgres?schema=api" // Custom env vars | ||
}, | ||
"postStartCommand": "yarn", // Install dependencies | ||
"extensions": [ | ||
"ms-azuretools.vscode-docker", | ||
"nrwl.angular-console", | ||
"esbenp.prettier-vscode", | ||
"firsttris.vscode-jest-runner", | ||
"dbaeumer.vscode-eslint" | ||
], | ||
"mounts": [ | ||
"source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" | ||
] | ||
} | ||
``` | ||
|
||
## Github Workflows | ||
TODO | ||
|
||
|
||
|
||
|