Skip to content

Support showing the readme on entity page #4704

Support showing the readme on entity page

Support showing the readme on entity page #4704

Workflow file for this run

name: Code CI
on:
push:
pull_request:
jobs:
lint:
# pull requests are a duplicate of a branch push if within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set node
uses: actions/setup-node@v4.0.3
with:
node-version: 18
- name: Install yarn dependencies
uses: borales/actions-yarn@v5.0.0
with:
cmd: install --frozen-lockfile
dir: backstage
- name: Lint all
uses: borales/actions-yarn@v5.0.0
with:
cmd: lint:all
dir: backstage
- name: Check format
uses: borales/actions-yarn@v5.0.0
with:
cmd: prettier:check
dir: backstage
test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set node
uses: actions/setup-node@v4.0.3
with:
node-version: 18
- name: Install yarn dependencies
uses: borales/actions-yarn@v5.0.0
with:
cmd: install --frozen-lockfile
dir: backstage
- name: Run all tests
uses: borales/actions-yarn@v5.0.0
with:
cmd: test:all
dir: backstage
containers:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
needs:
- lint
- test
strategy:
fail-fast: true
matrix:
target:
- backend
- frontend
max-parallel: 1
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Generate Image Name
run: echo IMAGE_REPOSITORY=ghcr.io/$(tr '[:upper:]' '[:lower:]' <<< "${{ github.repository }}")-${{ matrix.target }} >> $GITHUB_ENV
- name: Log in to GitHub Docker Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Metadata
id: meta
uses: docker/metadata-action@v5.5.1
with:
images: ${{ env.IMAGE_REPOSITORY }}
tags: |
type=ref,event=tag
type=raw,value=latest
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.6.1
- name: Build Image
uses: docker/build-push-action@v6.7.0
with:
context: "{{defaultContext}}:backstage"
target: ${{ matrix.target }}
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
load: ${{ ! (github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max