-
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
Amninder Kaur
committed
Jan 12, 2024
1 parent
429518b
commit 311d9f2
Showing
6 changed files
with
96 additions
and
0 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,7 @@ | ||
name: build | ||
|
||
on: push | ||
|
||
jobs: | ||
npm_build: | ||
uses: ./.github/workflows/npm_build.yml |
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,42 @@ | ||
name: ghcr.io Publish | ||
|
||
# when a new release is created or new tag is pushed to master | ||
# tag should be in the format v1.0.0 | ||
# v1.0.0-alpha.1 is also valid | ||
# regex to check the tag format | ||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]' | ||
- 'v[0-9]+.[0-9]+.[0-9]+-[a-zA-Z]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]+(-[a-zA-Z]+)+.[0-9]?' | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/npm_build.yml | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: needs.build.result == 'success' | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v3 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- run: PATH=$PATH:$(pwd) bin/ubuntu-setup.sh | ||
- run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- run: | | ||
echo $RELEASE_VERSION | ||
echo ${{ env.RELEASE_VERSION }} | ||
- name: Build and publish lock manager image with ver and latest tag | ||
run: sh bin/ghcr-publish.sh lock-manager ${{ env.RELEASE_VERSION }} | ||
|
||
|
||
|
||
|
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,18 @@ | ||
# workflow_call to build the rust app | ||
name: npm_build_and_test | ||
|
||
on: workflow_call | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
check-latest: true | ||
- name: npm install, build and test lock-manager | ||
run: sh bin/npm-build.sh lock-manager |
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,13 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
package_name=$1 | ||
version=$2 | ||
|
||
docker_file=$package_name/Dockerfile | ||
tag_with_version=pit-$package_name:v$version | ||
tag_ref=ghcr.io/kindredgroup/pit-toolkit/$tag_with_version | ||
echo $tag_ref | ||
docker build -f $docker_file . --tag $tag_ref | ||
#for ghcr.io access token mentioned in the github secrets and accessed in actions | ||
docker push $tag_ref |
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,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
package_name=$1 | ||
|
||
echo $(pwd) | ||
cd $(pwd)/$package_name | ||
npm install | ||
npm run build | ||
npm run test | ||
cd ../ |
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,4 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
sudo apt-get update && sudo apt-get install -y libsasl2-dev |