Skip to content

docs: Update the tech-radar process #629

docs: Update the tech-radar process

docs: Update the tech-radar process #629

Workflow file for this run

name: Commit
on:
pull_request:
push:
branches:
- master
repository_dispatch:
types:
- radar-release
jobs:
yamllint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./.scripts/python_requirements.txt
- name: Yaml lint
run: python .scripts/yaml_lint.py
- name: Verify schema
run: python .scripts/yaml_validate.py
test:
runs-on: ubuntu-latest
needs:
- yamllint
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: NPM install
run: |
npm ci
npm ci --prefix server
- name: Lint javascript
run: |
npm run lint:js -- \
--format junit \
--output-file test-results/eslint/TEST-eslint.xml
npm run lint:js --prefix=server -- \
--format junit \
--output-file test-results/eslint/TEST-eslint.xml
- name: Unit tests
run: |
npm test -- --ci --coverage
npm test --prefix server -- --ci --coverage
- name: Build radar
run: npm run build
- name: SonarCloud Scan
uses: extenda/actions/sonar-scanner@v0
with:
sonar-host: https://sonarcloud.io
service-account-key: ${{ secrets.SECRET_AUTH }}
release:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs:
- yamllint
- test
outputs:
docker-image-name: ${{ steps.docker-publish.outputs.docker-image-name }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: extenda/actions/gcp-secret-manager@v0
with:
service-account-key: ${{ secrets.SECRET_AUTH }}
secrets: |
ORG_TOKEN: github-token
- uses: extenda/actions/gcp-secret-manager@v0
with:
service-account-key: ${{ secrets.GCLOUD_AUTH }}
secrets: |
LD_CLIENT_ID: launchdarkly-client-id
- name: Checkout IT & BIS radar repository
uses: actions/checkout@v2
with:
token: ${{ env.ORG_TOKEN }}
repository: extenda/it-bis-radar
path: .it-bis_radar
- name: Copy IT & BIS radar
run: mv .it-bis_radar/radar radar_it
- name: Create release
uses: extenda/actions/conventional-release@v0
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: NPM install
run: |
npm ci
npm ci --prefix server
- name: Build radar
run: |
npm version ${{ steps.release.outputs.version }} --no-git-tag-version
npm version ${{ steps.release.outputs.version }} --no-git-tag-version --prefix server
npm run build
- uses: extenda/actions/setup-gcloud@v0
id: gcloud
with:
service-account-key: ${{ secrets.GCLOUD_AUTH }}
- name: Publish Docker image
id: docker-publish
run: |
gcloud auth configure-docker --quiet
IMAGE=gcr.io/${{ steps.gcloud.outputs.project-id }}/tech-radar:${{ steps.release.outputs.release-tag }}
echo "::set-output name=docker-image-name::$IMAGE"
docker build -t $IMAGE .
docker push $IMAGE
deploy:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs:
- release
steps:
- uses: actions/checkout@v2
- uses: extenda/actions/setup-gcloud@v0
id: gcloud
with:
service-account-key: ${{ secrets.GCLOUD_AUTH }}
- name: Deploy to Cloud Run
uses: extenda/actions/cloud-run@v0
with:
service-account-key: ${{ secrets.GCLOUD_AUTH }}
image: ${{ needs.release.outputs.docker-image-name }}