-
Notifications
You must be signed in to change notification settings - Fork 3
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
1 parent
130dff3
commit 0f739f4
Showing
3 changed files
with
61 additions
and
5 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,36 @@ | ||
name: Devops Test | ||
|
||
on: | ||
push: | ||
branches: [ devops-test-pipeline-0.2.0 ] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
get-version: | ||
name: Retrieve version | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
output1: ${{ steps.get-version.outputs.VERSION }} | ||
|
||
steps: | ||
- id: get-version | ||
run: | | ||
version=$(echo "${{ github.event.repository.default_branch }}" | sed -E 's/release-(.*)/\1/') | ||
echo "VERSION=$version" >> $GITHUB_OUTPUT | ||
devops-test: | ||
|
||
name: Devops test | ||
runs-on: ubuntu-latest | ||
needs: [get-version] | ||
|
||
env: | ||
VERSION: ${{ needs.get-version.outputs.output1 }} | ||
|
||
steps: | ||
|
||
- name: print version | ||
run: | | ||
echo "The default branch is ${{ env.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 |
---|---|---|
|
@@ -8,7 +8,6 @@ on: | |
- backend/** | ||
|
||
env: | ||
VERSION: 0.2.0 | ||
GIT_URL: https://github.com/bcgov/lcfs.git | ||
TOOLS_NAMESPACE: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-tools | ||
DEV_NAMESPACE: ${{ secrets.OPENSHIFT_NAMESPACE_PLATE }}-dev | ||
|
@@ -21,12 +20,30 @@ concurrency: | |
|
||
jobs: | ||
|
||
get-version: | ||
if: contains(github.event.pull_request.labels.*.name, 'build') && github.event.pull_request.base.ref == "${{ github.event.repository.default_branch }}" | ||
name: Retrieve version | ||
runs-on: ubuntu-latest | ||
|
||
outputs: | ||
output1: ${{ steps.get-version.outputs.VERSION }} | ||
|
||
steps: | ||
- id: get-version | ||
run: | | ||
version=$(echo "${{ github.event.repository.default_branch }}" | sed -E 's/release-(.*)/\1/') | ||
echo "VERSION=$version" >> $GITHUB_OUTPUT | ||
build: | ||
if: contains(github.event.pull_request.labels.*.name, 'build') | ||
if: contains(github.event.pull_request.labels.*.name, 'build') && github.event.pull_request.base.ref == "${{ github.event.repository.default_branch }}" | ||
name: Build LCFS | ||
runs-on: ubuntu-latest | ||
needs: [get-version] | ||
timeout-minutes: 60 | ||
|
||
env: | ||
VERSION: ${{ needs.get-version.outputs.output1 }} | ||
|
||
steps: | ||
|
||
- name: Check out repository | ||
|
@@ -42,6 +59,7 @@ jobs: | |
echo ${{ env.PR_NUMBER }} | ||
echo ${{ env.GIT_URL }} | ||
echo ${{ env.GIT_REF }} | ||
echo ${{ env.VERSION }} | ||
- name: Log in to Openshift | ||
uses: redhat-actions/[email protected] | ||
|
@@ -78,11 +96,14 @@ jobs: | |
oc tag ${{ env.TOOLS_NAMESPACE }}/lcfs-frontend:${{ env.VERSION }}-${{ env.PR_NUMBER }} ${{ env.DEV_NAMESPACE }}/lcfs-frontend:${{ env.VERSION }}-${{ env.PR_NUMBER }} | ||
deploy: | ||
if: contains(github.event.pull_request.labels.*.name, 'build') | ||
if: contains(github.event.pull_request.labels.*.name, 'build') && github.event.pull_request.base.ref == "${{ github.event.repository.default_branch }}" | ||
name: Deploy LCFS | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
needs: [build] | ||
needs: [get-version, build] | ||
|
||
env: | ||
VERSION: ${{ needs.get-version.outputs.output1 }} | ||
|
||
steps: | ||
|
||
|
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