Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding frontend CI pipelines #1429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Continuous-Integration
on:
workflow_run:
workflows:
- Semantic-Version-Bump
types:
- completed

jobs:
continuous-integration-build:
name: Continuous Integration Build
runs-on: vcp-runner

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags

- name: 'Get Current tag'
id: currenttag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 0.1.0 # Optional fallback tag to use when no tag can be found

- name: Docker Login
uses: docker/login-action@v2
with:
registry: ${{ secrets.VCR_HOST }}
username: ${{ secrets.VCR_USERNAME }}
password: ${{ secrets.VCR_PASSWORD }}
logout: "true"

- name: Pack the code
env:
REGISTRY: ${{ secrets.VCR_HOST }}
IMAGE_TAG: ${{ steps.currenttag.outputs.tag }}
CNB_CONFIG: ${{ secrets.CNB_CONFIG }}
run: |
builder="$REGISTRY/vonage/cnb-builder-frontend:20"
repoName=$(basename ${{ github.repository }} )
tag=$(echo "$REGISTRY/vonage/$repoName:$IMAGE_TAG" | tr '[:upper:]' '[:lower:]')
pack build $tag \
-e TARGET_PROJECT_VERSION=$IMAGE_TAG \
-e CNB_CONFIG=$CNB_CONFIG \
--builder $builder \
--clear-cache

docker push $tag

- name: AutoRelease
id: autorelease
uses: vonage/[email protected]
with:
repository: ${{ github.repository }}
owner: ${{ github.repository_owner }}
version: ${{ steps.currenttag.outputs.tag }}
token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
45 changes: 45 additions & 0 deletions .github/workflows/pull-request-integration-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Pull-Request-Integration-Build
on:
pull_request:
branches:
- main

jobs:
pull-request-integration-build:
name: Pull Request Integration Build
runs-on: vcp-runner

steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Required due to the way Git works, without it this action won't be able to find any or the correct tags

- name: 'Get Current tag'
id: currenttag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
with:
fallback: 0.1.0 # Optional fallback tag to use when no tag can be found

- name: Docker Login
uses: docker/login-action@v2
with:
registry: ${{ secrets.VCR_HOST }}
username: ${{ secrets.VCR_USERNAME }}
password: ${{ secrets.VCR_PASSWORD }}
logout: "true"

- name: Pack the code
env:
REGISTRY: ${{ secrets.VCR_HOST }}
IMAGE_TAG: ${{ steps.currenttag.outputs.tag }}
CNB_CONFIG: ${{ secrets.CNB_CONFIG }}
run: |
builder="$REGISTRY/vonage/cnb-builder-frontend:20"
repoName=$(basename ${{ github.repository }} )
tag=$(echo "$REGISTRY/vonage/$repoName:$IMAGE_TAG" | tr '[:upper:]' '[:lower:]')
pack build $tag \
-e TARGET_PROJECT_VERSION=$IMAGE_TAG \
-e CNB_CONFIG=$CNB_CONFIG \
--builder $builder \
--clear-cache
Loading