diff --git a/.github/workflows/image-release.yml b/.github/workflows/image-release.yml index 7ebad66..479b7eb 100644 --- a/.github/workflows/image-release.yml +++ b/.github/workflows/image-release.yml @@ -23,6 +23,10 @@ on: required: false type: boolean default: false + suffix: + required: false + type: string + default: "" secrets: registry-username: required: true @@ -30,7 +34,6 @@ on: required: true jobs: - release: runs-on: [self-hosted, ARM64, stable] environment: DOCKER_HUB @@ -46,6 +49,7 @@ jobs: ${{ inputs.image-name }} flavor: | latest=false + suffix=${{ inputs.suffix }} tags: | type=ref,event=branch type=ref,event=pr diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml deleted file mode 100644 index 1bcd006..0000000 --- a/.github/workflows/nightly.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Generate Nightly Image - -on: - workflow_dispatch: - -# schedule: -# - cron: '15 22 * * *' - -jobs: - - release: - runs-on: [self-hosted, ARM64, stable] - environment: DOCKER_HUB - - steps: - - - name: Checkout - uses: actions/checkout@v4 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v4 - with: - # list of Docker images to use as base name for tags - images: | - plone/plone-frontend - # update label with proper version number - labels: | - org.label-schema.docker.cmd=docker run -d -p 3000:3000 plone/plone-frontend:nightly - # generate Docker tags based on the following events/attributes - tags: | - type=raw,value=nightly - type=schedule,pattern=nightly-{{date 'YYYYMMDD'}} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.4.1 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v4 - with: - platforms: linux/amd64,linux/arm64 - context: . - file: Dockerfile.nightly - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e02b3f..257004c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ name: Release new Docker image on: push: tags: - - 'v*' + - "v*" workflow_dispatch: env: @@ -12,7 +12,6 @@ env: IS_LATEST: false jobs: - meta: runs-on: ubuntu-latest outputs: @@ -33,7 +32,7 @@ jobs: echo "IS_LATEST=$IS_LATEST" >> $GITHUB_OUTPUT echo "VOLTO_VERSION=$(cat version.txt)" >> $GITHUB_OUTPUT - builder-image: + pnpm-builder-image: needs: - meta uses: ./.github/workflows/image-release.yml @@ -47,7 +46,7 @@ jobs: registry-username: ${{ secrets.DOCKERHUB_USERNAME }} registry-password: ${{ secrets.DOCKERHUB_TOKEN }} - prod-conf-image: + pnpm-prod-conf-image: uses: ./.github/workflows/image-release.yml with: volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} @@ -62,7 +61,7 @@ jobs: needs: - meta - dev-image: + pnpm-dev-image: uses: ./.github/workflows/image-release.yml with: volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} @@ -75,9 +74,9 @@ jobs: registry-password: ${{ secrets.DOCKERHUB_TOKEN }} needs: - meta - - builder-image + - pnpm-builder-image - plone-frontend: + pnpm-plone-frontend: uses: ./.github/workflows/image-release.yml with: volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} @@ -90,5 +89,64 @@ jobs: registry-password: ${{ secrets.DOCKERHUB_TOKEN }} needs: - meta - - builder-image - - prod-conf-image + - pnpm-builder-image + - pnpm-prod-conf-image + + yarn-builder-image: + needs: + - meta + uses: ./.github/workflows/image-release.yml + with: + volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} + image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-builder + dockerfile: Dockerfile.builder + platforms: ${{ needs.meta.outputs.PLATFORMS }} + suffix: -yarn + secrets: + registry-username: ${{ secrets.DOCKERHUB_USERNAME }} + registry-password: ${{ secrets.DOCKERHUB_TOKEN }} + + yarn-prod-conf-image: + uses: ./.github/workflows/image-release.yml + with: + volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} + image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-prod-config + dockerfile: Dockerfile.prod + platforms: ${{ needs.meta.outputs.PLATFORMS }} + suffix: -yarn + secrets: + registry-username: ${{ secrets.DOCKERHUB_USERNAME }} + registry-password: ${{ secrets.DOCKERHUB_TOKEN }} + needs: + - meta + + yarn-dev-image: + uses: ./.github/workflows/image-release.yml + with: + volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} + image-name: ${{ needs.meta.outputs.BASE_IMAGE_NAME }}-dev + dockerfile: Dockerfile.dev + platforms: ${{ needs.meta.outputs.PLATFORMS }} + suffix: -yarn + secrets: + registry-username: ${{ secrets.DOCKERHUB_USERNAME }} + registry-password: ${{ secrets.DOCKERHUB_TOKEN }} + needs: + - meta + - yarn-builder-image + + yarn-plone-frontend: + uses: ./.github/workflows/image-release.yml + with: + volto-version: ${{ needs.meta.outputs.VOLTO_VERSION }} + image-name: plone/plone-frontend + dockerfile: Dockerfile + platforms: ${{ needs.meta.outputs.PLATFORMS }} + suffix: -yarn + secrets: + registry-username: ${{ secrets.DOCKERHUB_USERNAME }} + registry-password: ${{ secrets.DOCKERHUB_TOKEN }} + needs: + - meta + - yarn-builder-image + - yarn-prod-conf-image diff --git a/.github/workflows/runnertest.yml b/.github/workflows/runnertest.yml index 6f864a7..ea6b036 100644 --- a/.github/workflows/runnertest.yml +++ b/.github/workflows/runnertest.yml @@ -4,13 +4,11 @@ on: workflow_dispatch: jobs: - release: runs-on: [self-hosted, ARM64, Linux, unstable] environment: DOCKER_HUB steps: - - name: Checkout uses: actions/checkout@v4 @@ -45,7 +43,7 @@ jobs: with: platforms: linux/amd64,linux/arm64 context: . - file: Dockerfile.nightly + file: Dockerfile.builder push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile.nightly b/Dockerfile.nightly deleted file mode 100644 index e661bb6..0000000 --- a/Dockerfile.nightly +++ /dev/null @@ -1,38 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM node:18-slim as base -FROM base as builder - - -RUN <