Feat: Kubernetes Rioja DAY Announcement #87
Workflow file for this run
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
name: Linter y tests | |
on: | |
pull_request: | |
branches: | |
- master | |
types: [opened, reopened, synchronize] | |
jobs: | |
linter_y_tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
#registry-url: "https://npm.pkg.github.com" | |
- run: | | |
if [ -e yarn.lock ]; then | |
yarn install --frozen-lockfile | |
elif [ -e package-lock.json ]; then | |
npm ci | |
else | |
npm i | |
fi | |
- run: npm run lint | |
- run: npm run test | |
build-test-image: | |
runs-on: ubuntu-latest | |
needs: [linter_y_tests] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 'Determine tag' | |
run: 'echo "RELEASE_TAG=0.0.1" >> $GITHUB_ENV' | |
- name: Build the Docker image | |
run: docker build . -t cloudnativerioja/official-website:${{ env.RELEASE_TAG }} | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@master | |
with: | |
image-ref: 'cloudnativerioja/official-website:${{ env.RELEASE_TAG }}' | |
format: 'table' | |
exit-code: '1' | |
ignore-unfixed: true | |
vuln-type: 'os,library' | |
severity: 'CRITICAL' | |
- name: Run the Docker image | |
run: docker run -d -p 8080:80 cloudnativerioja/official-website:${{ env.RELEASE_TAG }} | |
- name: Test the Docker image | |
run: sleep 5 && curl -sSf localhost:8080 | grep -q 'Cloud Native Rioja' | |
chart-test: | |
runs-on: ubuntu-latest | |
needs: [build-test-image] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.12.1 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
check-latest: true | |
- name: Set up chart-testing | |
uses: helm/[email protected] | |
- name: Run chart-testing (list-changed) | |
id: list-changed | |
run: | | |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) | |
if [[ -n "$changed" ]]; then | |
echo "changed=true" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Run chart-testing (lint) | |
if: steps.list-changed.outputs.changed == 'true' | |
run: ct lint --target-branch ${{ github.event.repository.default_branch }} | |
- name: Create kind cluster | |
if: steps.list-changed.outputs.changed == 'true' | |
uses: helm/[email protected] | |
- name: Run chart-testing (install) | |
if: steps.list-changed.outputs.changed == 'true' | |
run: ct install --target-branch ${{ github.event.repository.default_branch }} |