name: Build Test Push description: Build, test and push Docker images for a given platform author: Julien Neuhart inputs: github_token: description: The GitHub token required: true default: ${{ github.token }} docker_hub_username: description: The Docker Hub username required: true docker_hub_password: description: The Docker Hub password required: true platform: description: linux/amd64, linux/ppc64le, linux/386, linux/arm64, linux/arm/v7 required: true version: description: Gotenberg version required: true skip_integrations_tests: description: Define whether to skip integration testing default: false alternate_repository: description: Alternate repository to push the tags to dry_run: description: Dry run this action outputs: tags: description: Comma separated list of tag value: ${{ steps.build.outputs.tags }} tags_cloud_run: description: Comma separated list of Cloud Run tags (linux/amd64 only) value: ${{ steps.build.outputs.tags_cloud_run }} tags_aws_lambda: description: Comma separated list of AWS Lambda tags (linux/amd64 and linux/arm64 only) value: ${{ steps.build.outputs.tags_aws_lambda }} runs: using: composite steps: - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Check out code uses: actions/checkout@v5 - name: Log in to Docker Hub if: inputs.docker_hub_username != '' uses: docker/login-action@v3 with: username: ${{ inputs.docker_hub_username }} password: ${{ inputs.docker_hub_password }} - name: Build ${{ inputs.platform }} id: build shell: bash env: INPUT_VERSION: ${{ inputs.version }} INPUT_PLATFORM: ${{ inputs.platform }} INPUT_ALTERNATE_REPOSITORY: ${{ inputs.alternate_repository }} INPUT_DRY_RUN: ${{ inputs.dry_run }} run: | .github/actions/build-test-push/build.sh \ --version "$INPUT_VERSION" \ --platform "$INPUT_PLATFORM" \ --alternate-repository "$INPUT_ALTERNATE_REPOSITORY" \ --dry-run "$INPUT_DRY_RUN" - name: Run integration tests if: inputs.skip_integrations_tests != 'true' shell: bash env: INPUT_VERSION: ${{ inputs.version }} INPUT_PLATFORM: ${{ inputs.platform }} INPUT_ALTERNATE_REPOSITORY: ${{ inputs.alternate_repository }} INPUT_DRY_RUN: ${{ inputs.dry_run }} run: | .github/actions/build-test-push/test.sh \ --version "$INPUT_VERSION" \ --platform "$INPUT_PLATFORM" \ --alternate-repository "$INPUT_ALTERNATE_REPOSITORY" \ --dry-run "$INPUT_DRY_RUN" - name: Push if: inputs.docker_hub_username != '' shell: bash env: INPUT_TAGS: ${{ steps.build.outputs.tags }},${{ steps.build.outputs.tags_cloud_run }},${{ steps.build.outputs.tags_aws_lambda }} INPUT_DRY_RUN: ${{ inputs.dry_run }} run: | .github/actions/build-test-push/push.sh \ --tags "$INPUT_TAGS" \ --dry-run "$INPUT_DRY_RUN" - name: Outputs shell: bash run: | echo "tags=${{ steps.build.outputs.tags }}" echo "tags_cloud_run=${{ steps.build.outputs.tags_cloud_run }}" echo "tags_aws_lambda=${{ steps.build.outputs.tags_aws_lambda }}"