Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* chore(editor): setup indent size for yaml file * chore(docker): update docker file * chore(build): same build process as in DSP-APP * chore(build): add makefile and vars * chore(gh-action): add release please * chore(gh-actions): do not use matrix strategy * fix(docker): fix the build * refactor(gh-action): split test and build into two steps * chore(deps): update packages * fix(gh-actions): use default GITHUB_TOKEN * fix(release-please): add changelog file * chore: set correct version * refactor: resolve dead links * chore(docker): publish on daschswiss docker hub * chore(gh-actions): use the right gh token
- Loading branch information
1 parent
1dbd0ca
commit f95c55e
Showing
10 changed files
with
4,835 additions
and
3,460 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
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,24 +1,79 @@ | ||
name: CI | ||
env: | ||
NV: 12.x # node version | ||
|
||
on: | ||
push: | ||
push: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-test: | ||
name: Build and Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [ 12.x ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run Unit Tests | ||
run: npm run test-ci | ||
- name: Build app | ||
run: docker build . | ||
|
||
test: | ||
name: Test the app | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
- name: Set up Node.js ${{ env.NV }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.NV }} | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Run Unit Tests | ||
run: npm run test-ci | ||
|
||
build: | ||
name: Build the app | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
- name: Set up Node.js ${{ env.NV }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ env.NV }} | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Build in prod mode | ||
run: docker build . | ||
|
||
release-please: | ||
name: Prepare next release | ||
runs-on: ubuntu-latest | ||
# Automate releases with Conventional Commit Messages as Pull Requests are merged into "develop" branch | ||
if: github.ref == 'refs/heads/develop' | ||
steps: | ||
- name: Get release please action | ||
uses: GoogleCloudPlatform/release-please-action@v2 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
release-type: node | ||
package-name: beol | ||
changelog-types: '[ | ||
{"type": "feat", "section": "Enhancements", "hidden": false }, | ||
{"type": "fix", "section": "Bug Fixes", "hidden": false }, | ||
{"type": "chore", "section": "Maintenance", "hidden": false }, | ||
{"type": "refactor", "section": "Maintenance", "hidden": false }, | ||
{"type": "docs", "section": "Documentation", "hidden": false } | ||
]' | ||
|
||
# publish only on release | ||
publish: | ||
name: Publish to Dockerhub | ||
needs: [ | ||
build, | ||
test | ||
] | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags') | ||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 50 | ||
- name: Build and publish image | ||
run: | | ||
echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin | ||
make publish-beol-image |
Empty file.
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,25 @@ | ||
# Determine this makefile's path. | ||
# Be sure to place this BEFORE `include` directives, if any. | ||
# THIS_FILE := $(lastword $(MAKEFILE_LIST)) | ||
THIS_FILE := $(abspath $(lastword $(MAKEFILE_LIST))) | ||
CURRENT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) | ||
|
||
include vars.mk | ||
|
||
################################# | ||
# Build and publish targets | ||
################################# | ||
.PHONY: build-beol-image | ||
build-beol-image: ## build BEOL APP image locally | ||
docker build -t $(BEOL_IMAGE) . | ||
docker tag $(BEOL_IMAGE) $(BEOL_REPO):latest | ||
|
||
.PHONY: publish-beol-image | ||
publish-beol-image: build-beol-image ## publish BEOL APP Docker image to Docker-Hub | ||
docker image push --all-tags $(BEOL_REPO) | ||
|
||
.PHONY: help | ||
help: ## this help | ||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort | ||
|
||
.DEFAULT_GOAL := help |
Oops, something went wrong.