Skip to content

Dev/UI nextjs

Dev/UI nextjs #59

Workflow file for this run

name: Docker
on:
push:
branches: ["main"]
tags: ["v*.*.*"]
pull_request:
branches: ["main"]
permissions:
contents: write
packages: write
id-token: write
jobs:
setup:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.value }}
steps:
- name: Compute version
id: version
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
echo "value=${{ github.ref_name }}" >> $GITHUB_OUTPUT
else
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
echo "value=sha-${SHORT_SHA}" >> $GITHUB_OUTPUT
fi
quality:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ui-next
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: ui-next/package-lock.json
- name: Install dependencies
run: npm install
- name: Lint
run: npm run lint
- name: Build check
run: npm run build
env:
AUTH_SECRET: ci-placeholder
DATABASE_URL: ":memory:"
build-ui:
needs: [setup, quality]
uses: ./.github/workflows/docker-build.yml
with:
image_name: ${{ github.repository }}-ui
context: ui/.
version: ${{ needs.setup.outputs.version }}
registry: ghcr.io
push: ${{ github.event_name != 'pull_request' }}
secrets:
registry_token: ${{ secrets.GITHUB_TOKEN }}
build-ui-next:
needs: [setup, quality]
uses: ./.github/workflows/docker-build.yml
with:
image_name: ${{ github.repository }}-ui-next
context: ui-next/.
version: ${{ needs.setup.outputs.version }}
registry: ghcr.io
push: ${{ github.event_name != 'pull_request' }}
secrets:
registry_token: ${{ secrets.GITHUB_TOKEN }}
build-ansible:
needs: [setup, quality]
uses: ./.github/workflows/docker-build.yml
with:
image_name: ${{ github.repository }}-ansible
context: ansible/.
version: ${{ needs.setup.outputs.version }}
registry: ghcr.io
push: ${{ github.event_name != 'pull_request' }}
secrets:
registry_token: ${{ secrets.GITHUB_TOKEN }}
release:
needs: [build-ui, build-ui-next, build-ansible]
runs-on: ubuntu-latest
permissions:
contents: write
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true