Merge pull request #30 from nordeck/nic/fix/ZO-175 #43
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: Release | |
on: | |
push: | |
branches: | |
- main | |
- '[0-9].x' | |
- '[0-9].[0-9]+.x' | |
pull_request: | |
env: | |
DOCKER_IMAGE: ghcr.io/nordeck/ovc-frontend | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
outputs: | |
docker-tag: ${{ steps.meta.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# required for changesets | |
fetch-depth: '0' | |
# don't persist the credentials so the changesets action doesn't use the | |
# github actions token but the git token provided via environment variable | |
persist-credentials: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
- name: Setup semantic-release | |
run: npm install -g semantic-release @semantic-release/git @semantic-release/npm @semantic-release/changelog @semantic-release/exec -D | |
- name: Release | |
id: release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npx semantic-release | |
- name: Login to ghcr.io | |
if: ${{ steps.release.outputs.RELEASE_VERSION }} | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Generate Docker metadata | |
if: ${{ steps.release.outputs.RELEASE_VERSION }} | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ env.DOCKER_IMAGE }} | |
labels: | | |
org.opencontainers.image.title=ovc-frontend | |
org.opencontainers.image.description=openDesk Video Conference Frontend. | |
org.opencontainers.image.vendor=Nordeck IT + Consulting GmbH | |
tags: | | |
type=semver,pattern={{version}},value=${{ steps.release.outputs.RELEASE_VERSION }} | |
type=semver,pattern={{major}}.{{minor}},value=${{ steps.release.outputs.RELEASE_VERSION }} | |
type=semver,pattern={{major}},value=${{ steps.release.outputs.RELEASE_VERSION }} | |
type=raw,value=latest | |
- name: Setup buildx | |
if: ${{ steps.release.outputs.RELEASE_VERSION }} | |
uses: docker/setup-buildx-action@v3 | |
with: | |
platforms: linux/amd64,linux/arm64,linux/s390x | |
- name: Docker build and push | |
if: ${{ steps.release.outputs.RELEASE_VERSION }} | |
uses: docker/build-push-action@v6 | |
id: dockerBuild | |
with: | |
push: true | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64 | |
build-args: | | |
NEXT_PUBLIC_APP_VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} | |
NEXT_PUBLIC_BACKEND_BASE_URL=https://api.dvb.integration.dvb.nordeck.io | |
NEXT_PUBLIC_JITSI_LINK=https://jitsi.integration.dvb.nordeck.io/ |