CI for website (#1469)
## Description CI for website, useful for dependabot tests. ## Type of change <!--- Please check the type of change your PR introduces: ---> - [ ] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Test - [x] 💻 CI/Deployment - [ ] 🐹 Trivial/Minor ## Issue(s) <!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. --> * #<issue> ## Test Plan <!-- How will this be tested prior to merging.--> - [x] 💪 Manual - [ ] ⚡ Unit test - [ ] 💚 E2E Co-authored-by: Vaibhav Kamra <vkamra@alcion.ai>
This commit is contained in:
parent
825cd6f21b
commit
2e33f37cee
15
.github/workflows/_filechange_checker.yml
vendored
15
.github/workflows/_filechange_checker.yml
vendored
@ -9,6 +9,9 @@ on:
|
|||||||
docfileschanged:
|
docfileschanged:
|
||||||
description: "'true' if docs/** or src/** or .github/workflows/** files have changed in the branch"
|
description: "'true' if docs/** or src/** or .github/workflows/** files have changed in the branch"
|
||||||
value: ${{ jobs.file-change-check.outputs.docfileschanged }}
|
value: ${{ jobs.file-change-check.outputs.docfileschanged }}
|
||||||
|
websitefileschanged:
|
||||||
|
description: "'true' if websites/** or .github/workflows/** files have changed in the branch"
|
||||||
|
value: ${{ jobs.file-change-check.outputs.websitefileschanged }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
file-change-check:
|
file-change-check:
|
||||||
@ -19,6 +22,7 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
srcfileschanged: ${{ steps.srcchecker.outputs.srcfileschanged }}
|
srcfileschanged: ${{ steps.srcchecker.outputs.srcfileschanged }}
|
||||||
docfileschanged: ${{ steps.docchecker.outputs.docfileschanged }}
|
docfileschanged: ${{ steps.docchecker.outputs.docfileschanged }}
|
||||||
|
websitefileschanged: ${{ steps.websitechecker.outputs.websitefileschanged }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
@ -33,6 +37,8 @@ jobs:
|
|||||||
- 'src/**'
|
- 'src/**'
|
||||||
docs:
|
docs:
|
||||||
- 'docs/**'
|
- 'docs/**'
|
||||||
|
website:
|
||||||
|
- 'website/**'
|
||||||
actions:
|
actions:
|
||||||
- '.github/workflows/**'
|
- '.github/workflows/**'
|
||||||
- '.github/actions/**'
|
- '.github/actions/**'
|
||||||
@ -49,4 +55,11 @@ jobs:
|
|||||||
if: steps.dornycheck.outputs.src == 'true' || steps.dornycheck.outputs.docs == 'true' || steps.dornycheck.outputs.actions == 'true'
|
if: steps.dornycheck.outputs.src == 'true' || steps.dornycheck.outputs.docs == 'true' || steps.dornycheck.outputs.actions == 'true'
|
||||||
run: |
|
run: |
|
||||||
echo "docs, src or workflow file changes occurred"
|
echo "docs, src or workflow file changes occurred"
|
||||||
echo ::set-output name=docfileschanged::true
|
echo ::set-output name=docfileschanged::true
|
||||||
|
|
||||||
|
- name: Check dorny for changes in website related filepaths
|
||||||
|
id: websitechecker
|
||||||
|
if: steps.dornycheck.outputs.website == 'true' || steps.dornycheck.outputs.actions == 'true'
|
||||||
|
run: |
|
||||||
|
echo "website or workflow file changes occurred"
|
||||||
|
echo ::set-output name=websitefileschanged::true
|
||||||
34
.github/workflows/website-ci.yml
vendored
Normal file
34
.github/workflows/website-ci.yml
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
name: CI for Website
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
# cancel currently running jobs if a new version of the branch is pushed
|
||||||
|
concurrency:
|
||||||
|
group: website-ci-${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
Precheck:
|
||||||
|
uses: alcionai/corso/.github/workflows/_filechange_checker.yml@main
|
||||||
|
|
||||||
|
Website-Build:
|
||||||
|
needs: [Precheck]
|
||||||
|
environment: Testing
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.ref == 'refs/heads/main' || needs.precheck.outputs.websitefileschanged == 'true'
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
working-directory: website
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Build website image
|
||||||
|
run: |
|
||||||
|
make buildimage
|
||||||
|
|
||||||
|
- name: Build website
|
||||||
|
run: |
|
||||||
|
make build
|
||||||
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
WEBC := docker run --rm -it --init -p 5050:3000 -p 5051:3001 \
|
WEBC := docker run --rm -it --init -p 5050:3000 -p 5051:3001 \
|
||||||
-v ${PWD}:/usr/src/website corso/website:latest
|
-v ${PWD}:/usr/src/website corso/website:latest
|
||||||
|
ifeq (${CI},true)
|
||||||
|
# Cannot run in interactive/tty mode in CI
|
||||||
|
WEBC := docker run --rm --init -p 5050:3000 -p 5051:3001 \
|
||||||
|
-v ${PWD}:/usr/src/website corso/website:latest
|
||||||
|
endif
|
||||||
|
|
||||||
buildimage: clean
|
buildimage: clean
|
||||||
docker build -t "corso/website:latest" .
|
docker build -t "corso/website:latest" .
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user