name: docker-push on: push jobs: build-and-push-images: strategy: matrix: app: - name: neo4j context: neo4j file: neo4j/Dockerfile target: community - name: backend-base context: backend file: backend/Dockerfile target: base - name: backend-build context: backend file: backend/Dockerfile target: build - name: backend context: backend file: backend/Dockerfile target: production - name: webapp-base context: webapp file: webapp/Dockerfile target: base - name: webapp-build context: webapp file: webapp/Dockerfile target: build - name: webapp context: webapp file: webapp/Dockerfile target: production - name: maintenance-base context: webapp file: webapp/Dockerfile.maintenance target: base - name: maintenance-build context: webapp file: webapp/Dockerfile.maintenance target: build - name: maintenance context: webapp file: webapp/Dockerfile.maintenance target: production runs-on: ubuntu-latest env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }}/${{ matrix.app.name }} permissions: contents: read packages: write attestations: write id-token: write steps: - name: Checkout repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7 - name: Log in to the Container registry uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=schedule type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=ref,event=branch type=ref,event=pr type=sha - name: Build and push Docker images id: push uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 with: context: ${{ matrix.app.context }} target: ${{ matrix.app.target }} file: ${{ matrix.app.file }} push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}