Dev/UI nextjs #57
Workflow file for this run
This file contains hidden or 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: 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 | |
| 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 ci --prefix ui-next | |
| - name: Lint | |
| run: npm run lint --prefix ui-next | |
| - name: Build check | |
| run: npm run build --prefix ui-next | |
| 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 |