-
Notifications
You must be signed in to change notification settings - Fork 46
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
5 changed files
with
124 additions
and
88 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,83 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags-ignore: | ||
- '**' | ||
|
||
jobs: | ||
build_ilc: | ||
name: Build ILC | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Docker ilc auth | ||
run: echo "${{ secrets.DOCKER_HUB_TOKEN_NC }}" | docker login --username namecheaprnd --password-stdin | ||
|
||
- name: Build the Docker image | ||
run: | | ||
cd ./ilc/ | ||
docker build . --tag ilc:tmp | ||
- name: Run tests | ||
run: docker run ilc:tmp npm run test | ||
|
||
- name: Calc tags | ||
id: tags | ||
run: | | ||
BRANCH=$(echo ${GITHUB_REF} | cut -d '/' -f 3-99) | ||
LATEST=$([ "$BRANCH" == "master" ] && echo "latest,${GITHUB_SHA:0:7}," || echo "") | ||
DOCKER_TAGS="$LATEST${BRANCH//\//_}" | ||
echo "Tags that will be used: $DOCKER_TAGS" | ||
echo ::set-output name=docker_tags::$DOCKER_TAGS | ||
- name: Push image | ||
run: | | ||
TAGS="${{ steps.tags.outputs.docker_tags }}" | ||
for i in ${TAGS//,/ } | ||
do | ||
docker tag ilc:tmp namecheap/ilc:$i | ||
docker push namecheap/ilc:$i | ||
done | ||
build_registry: | ||
name: Build Registry | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Docker registry auth | ||
run: echo "${{ secrets.DOCKER_HUB_TOKEN_NC }}" | docker login --username namecheaprnd --password-stdin | ||
|
||
- name: Build the Docker image | ||
run: | | ||
cd ./registry/ | ||
docker build . --tag registry:tmp | ||
- name: Run tests | ||
run: docker run registry:tmp npm run test:ci | ||
|
||
- name: Calc tags | ||
id: tags | ||
run: | | ||
BRANCH=$(echo ${GITHUB_REF} | cut -d '/' -f 3-99) | ||
LATEST=$([ "$BRANCH" == "master" ] && echo "latest,${GITHUB_SHA:0:7}," || echo "") | ||
DOCKER_TAGS="$LATEST${BRANCH//\//_}" | ||
echo "Tags that will be used: $DOCKER_TAGS" | ||
echo ::set-output name=docker_tags::$DOCKER_TAGS | ||
- name: Push image | ||
run: | | ||
TAGS="${{ steps.tags.outputs.docker_tags }}" | ||
for i in ${TAGS//,/ } | ||
do | ||
docker tag registry:tmp namecheap/ilc_registry:$i | ||
docker push namecheap/ilc_registry:$i | ||
done |
This file was deleted.
Oops, something went wrong.
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
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