mirror of
https://github.com/getredash/redash.git
synced 2026-03-21 07:00:07 -04:00
* Snapshot: 24.07.0-dev * Snapshot: 24.08.0-dev * Snapshot: 24.09.0-dev * Snapshot: 24.10.0-dev * Snapshot: 24.11.0-dev * Snapshot: 24.12.0-dev * Snapshot: 25.01.0-dev * Snapshot: 25.02.0-dev * Snapshot: 25.03.0-dev * Snapshot: 25.04.0-dev * Upgrade Node.js version to 24 in Dockerfile and .nvmrc; update package.json engine constraints * Update major dependencies * Switch from yarn to pnpm * Switch from yarn to pnpm: ci * Update Python version to 3.13 in CI workflow * Refactor Netlify build command to remove pnpm installation step * Update ESLint configuration for improved compatibility and disable specific rules * Restyled by prettier * Add typeRoots and types to tsconfig for improved type definitions * Update Dockerfile.cypress to use Node 24 and streamline installation steps * Fixed tests * Restyled by prettier * Update Jest snapshot comments to point to the official documentation URL * viz-lib: refactor test setup and update snapshots for consistency * Add babel-jest as a dev dependency for improved testing support * Add virtual prop to visualization type selector for improved functionality * Remove CJS/ESM compatibility shim for color-rgba * Restyled by prettier * Enable ESLintPlugin conditionally based on production environment * Import d3 library in d3box.ts * Fix pip install command in CI workflow to use python -m * Replace d3 import with global declaration for compatibility with d3 v3 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Restyled.io <commits@restyled.io>
187 lines
6.2 KiB
YAML
187 lines
6.2 KiB
YAML
name: Preview Image
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*-dev'
|
|
workflow_dispatch:
|
|
inputs:
|
|
dockerRepository:
|
|
description: 'Docker repository'
|
|
required: true
|
|
default: 'preview'
|
|
type: choice
|
|
options:
|
|
- preview
|
|
- redash
|
|
|
|
env:
|
|
NODE_VERSION: 24
|
|
|
|
jobs:
|
|
build-skip-check:
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
skip: ${{ steps.skip-check.outputs.skip }}
|
|
steps:
|
|
- name: Skip?
|
|
id: skip-check
|
|
run: |
|
|
if [[ "${{ vars.DOCKER_USER }}" == '' ]]; then
|
|
echo 'Docker user is empty. Skipping build+push'
|
|
echo skip=true >> "$GITHUB_OUTPUT"
|
|
elif [[ "${{ secrets.DOCKER_PASS }}" == '' ]]; then
|
|
echo 'Docker password is empty. Skipping build+push'
|
|
echo skip=true >> "$GITHUB_OUTPUT"
|
|
elif [[ "${{ vars.DOCKER_REPOSITORY }}" == '' ]]; then
|
|
echo 'Docker repository is empty. Skipping build+push'
|
|
echo skip=true >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo 'Docker user and password are set and branch is `master`.'
|
|
echo 'Building + pushing `preview` image.'
|
|
echo skip=false >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
build-docker-image:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
arch:
|
|
- amd64
|
|
- arm64
|
|
include:
|
|
- arch: amd64
|
|
os: ubuntu-22.04
|
|
- arch: arm64
|
|
os: ubuntu-22.04-arm
|
|
outputs:
|
|
VERSION_TAG: ${{ steps.version.outputs.VERSION_TAG }}
|
|
needs:
|
|
- build-skip-check
|
|
if: needs.build-skip-check.outputs.skip == 'false'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
ref: ${{ github.event.push.after }}
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.30.3
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
cache: 'pnpm'
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ vars.DOCKER_USER }}
|
|
password: ${{ secrets.DOCKER_PASS }}
|
|
|
|
- name: Install Dependencies
|
|
env:
|
|
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Set version
|
|
id: version
|
|
run: |
|
|
set -x
|
|
.ci/update_version
|
|
VERSION_TAG=$(jq -r .version package.json)
|
|
echo "VERSION_TAG=$VERSION_TAG" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build and push preview image to Docker Hub
|
|
id: build-preview
|
|
uses: docker/build-push-action@v4
|
|
if: ${{ github.event.inputs.dockerRepository == 'preview' || !github.event.workflow_run }}
|
|
with:
|
|
tags: |
|
|
${{ vars.DOCKER_REPOSITORY }}/redash
|
|
${{ vars.DOCKER_REPOSITORY }}/preview
|
|
context: .
|
|
build-args: |
|
|
test_all_deps=true
|
|
outputs: type=image,push-by-digest=true,push=true
|
|
cache-from: type=gha,scope=${{ matrix.arch }}
|
|
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}
|
|
env:
|
|
DOCKER_CONTENT_TRUST: true
|
|
|
|
- name: Build and push release image to Docker Hub
|
|
id: build-release
|
|
uses: docker/build-push-action@v4
|
|
if: ${{ github.event.inputs.dockerRepository == 'redash' }}
|
|
with:
|
|
tags: |
|
|
${{ vars.DOCKER_REPOSITORY }}/redash:${{ steps.version.outputs.VERSION_TAG }}
|
|
context: .
|
|
build-args: |
|
|
test_all_deps=true
|
|
outputs: type=image,push-by-digest=false,push=true
|
|
cache-from: type=gha,scope=${{ matrix.arch }}
|
|
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}
|
|
env:
|
|
DOCKER_CONTENT_TRUST: true
|
|
|
|
- name: "Failure: output container logs to console"
|
|
if: failure()
|
|
run: docker compose logs
|
|
|
|
- name: Export digest
|
|
run: |
|
|
mkdir -p ${{ runner.temp }}/digests
|
|
if [[ "${{ github.event.inputs.dockerRepository }}" == 'preview' || !github.event.workflow_run ]]; then
|
|
digest="${{ steps.build-preview.outputs.digest}}"
|
|
else
|
|
digest="${{ steps.build-release.outputs.digest}}"
|
|
fi
|
|
touch "${{ runner.temp }}/digests/${digest#sha256:}"
|
|
|
|
- name: Upload digest
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: digests-${{ matrix.arch }}
|
|
path: ${{ runner.temp }}/digests/*
|
|
if-no-files-found: error
|
|
|
|
merge-docker-image:
|
|
runs-on: ubuntu-22.04
|
|
needs: build-docker-image
|
|
steps:
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v3
|
|
with:
|
|
username: ${{ vars.DOCKER_USER }}
|
|
password: ${{ secrets.DOCKER_PASS }}
|
|
|
|
- name: Download digests
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: ${{ runner.temp }}/digests
|
|
pattern: digests-*
|
|
merge-multiple: true
|
|
|
|
- name: Create and push manifest for the preview image
|
|
if: ${{ github.event.inputs.dockerRepository == 'preview' || !github.event.workflow_run }}
|
|
working-directory: ${{ runner.temp }}/digests
|
|
run: |
|
|
docker buildx imagetools create -t ${{ vars.DOCKER_REPOSITORY }}/redash:preview \
|
|
$(printf '${{ vars.DOCKER_REPOSITORY }}/redash:preview@sha256:%s ' *)
|
|
docker buildx imagetools create -t ${{ vars.DOCKER_REPOSITORY }}/preview:${{ needs.build-docker-image.outputs.VERSION_TAG }} \
|
|
$(printf '${{ vars.DOCKER_REPOSITORY }}/preview:${{ needs.build-docker-image.outputs.VERSION_TAG }}@sha256:%s ' *)
|
|
|
|
- name: Create and push manifest for the release image
|
|
if: ${{ github.event.inputs.dockerRepository == 'redash' }}
|
|
working-directory: ${{ runner.temp }}/digests
|
|
run: |
|
|
docker buildx imagetools create -t ${{ vars.DOCKER_REPOSITORY }}/redash:${{ needs.build-docker-image.outputs.VERSION_TAG }} \
|
|
$(printf '${{ vars.DOCKER_REPOSITORY }}/redash:${{ needs.build-docker-image.outputs.VERSION_TAG }}@sha256:%s ' *)
|