Docker image for CI #29
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 image for CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '.github/workflows/build-ci-runner-image.yml' | |
| - 'docker/ci-runner.Dockerfile' | |
| workflow_dispatch: | |
| inputs: | |
| nodejs_version: | |
| description: 'Node.js version to use' | |
| type: string | |
| required: true | |
| obsidian_version: | |
| description: 'Obsidian version to test with' | |
| type: string | |
| required: true | |
| debian_version: | |
| description: 'Debian codename version to use' | |
| type: string | |
| required: true | |
| env: | |
| NODEJS_VERSION: ${{ inputs.nodejs_version || '22' }} | |
| OBSIDIAN_VERSION: ${{ inputs.obsidian_version || '1.9.14' }} | |
| DEBIAN_VERSION: ${{ inputs.debian_version || 'trixie' }} | |
| IMAGE_NAME: ghcr.io/${{ github.repository }}/ci-runner | |
| DOCKERFILE_PATH: docker/ci-runner.Dockerfile | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare metadata for tags and labels | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=node-${{ env.NODEJS_VERSION }}-obsidian-${{ env.OBSIDIAN_VERSION }}-${{ env.DEBIAN_VERSION }}-slim | |
| labels: | | |
| org.opencontainers.image.title: Obsidian plugins CI runner | |
| org.opencontainers.image.description=Docker image for building and testing obsidian plugins (with E2E tests support) | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| file: ${{ env.DOCKERFILE_PATH }} | |
| build-args: | | |
| NODEJS_VERSION=${{ env.NODEJS_VERSION }} | |
| DEBIAN_VERSION=${{ env.DEBIAN_VERSION }} | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |