Skip to content

README updated (#119) #5

README updated (#119)

README updated (#119) #5

name: Create and publish container images
on:
push:
branches: ["main"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: webui/package-lock.json
- name: Install WebUI dependencies
working-directory: webui
run: npm ci
- name: Run WebUI tests
working-directory: webui
run: npm test -- --run
build-and-push-images:
runs-on: ubuntu-latest
needs: test
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and push dapi container (main Dockerfile)
- name: Extract metadata (tags, labels) for dapi container
id: meta-dapi
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha
type=raw,value=latest
- name: Build and push dapi image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85
with:
context: .
push: true
tags: ${{ steps.meta-dapi.outputs.tags }}
labels: ${{ steps.meta-dapi.outputs.labels }}
# Build and push WebUI container
- name: Extract metadata (tags, labels) for WebUI container
id: meta-webui
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-webui
tags: |
type=sha
type=raw,value=latest
- name: Build and push WebUI image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85
with:
context: webui/.
push: true
tags: ${{ steps.meta-webui.outputs.tags }}
labels: ${{ steps.meta-webui.outputs.labels }}
# Build and push DevPortal container
- name: Extract metadata (tags, labels) for DevPortal container
id: meta-devportal
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-devportal
tags: |
type=sha
type=raw,value=latest
- name: Build and push DevPortal image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85
with:
context: contrib/devportal/redocly/.
push: true
tags: ${{ steps.meta-devportal.outputs.tags }}
labels: ${{ steps.meta-devportal.outputs.labels }}