2024-03-13 19:26:48 -04:00
|
|
|
name: Build & publish docker images
|
2020-11-13 14:32:18 -05:00
|
|
|
|
2020-11-27 04:38:38 -05:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2024-02-28 10:15:28 -05:00
|
|
|
- "master"
|
2024-03-06 12:23:07 -05:00
|
|
|
- "[0-9].[0-9]"
|
2020-11-27 04:38:38 -05:00
|
|
|
pull_request:
|
2024-02-22 11:14:41 -05:00
|
|
|
branches:
|
2024-02-28 10:15:28 -05:00
|
|
|
- "master"
|
2020-11-13 14:32:18 -05:00
|
|
|
|
2024-01-31 02:03:25 -05:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-11-13 14:32:18 -05:00
|
|
|
jobs:
|
2024-02-27 11:39:11 -05:00
|
|
|
setup_matrix:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
matrix_config: ${{ steps.set_matrix.outputs.matrix_config }}
|
|
|
|
steps:
|
|
|
|
- id: set_matrix
|
|
|
|
run: |
|
|
|
|
MATRIX_CONFIG=$(if [ "${{ github.event_name }}" == "pull_request" ]; then echo '["ci"]'; else echo '["dev", "lean", "py310", "websocket", "dockerize"]'; fi)
|
|
|
|
echo "matrix_config=${MATRIX_CONFIG}" >> $GITHUB_OUTPUT
|
|
|
|
echo $GITHUB_OUTPUT
|
|
|
|
|
2023-04-14 11:23:00 -04:00
|
|
|
docker-build:
|
2021-02-06 19:25:46 -05:00
|
|
|
name: docker-build
|
2024-02-27 11:39:11 -05:00
|
|
|
needs: setup_matrix
|
2020-11-13 14:32:18 -05:00
|
|
|
runs-on: ubuntu-latest
|
2024-01-23 16:44:07 -05:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2024-02-27 11:39:11 -05:00
|
|
|
build_preset: ${{fromJson(needs.setup_matrix.outputs.matrix_config)}}
|
2024-01-23 16:44:07 -05:00
|
|
|
fail-fast: false
|
2024-03-14 14:27:55 -04:00
|
|
|
env:
|
|
|
|
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
|
|
|
|
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2020-11-13 14:32:18 -05:00
|
|
|
steps:
|
2024-01-23 16:44:07 -05:00
|
|
|
|
2023-09-25 16:08:21 -04:00
|
|
|
- name: Set up QEMU
|
2024-01-23 16:44:07 -05:00
|
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
|
2023-09-25 16:08:21 -04:00
|
|
|
- name: Set up Docker Buildx
|
2024-01-23 16:44:07 -05:00
|
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
|
2024-03-14 14:27:55 -04:00
|
|
|
- name: Try to login to DockerHub
|
|
|
|
continue-on-error: true
|
|
|
|
uses: docker/login-action@v3
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USER }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
|
2024-03-13 19:26:48 -04:00
|
|
|
- name: Setup Node Env
|
|
|
|
uses: actions/setup-node@v4
|
|
|
|
with:
|
|
|
|
node-version: '20'
|
|
|
|
|
|
|
|
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
|
2024-03-25 11:58:22 -04:00
|
|
|
- name: Setup supersetbot
|
|
|
|
uses: ./.github/actions/setup-supersetbot/
|
|
|
|
|
2024-01-23 16:44:07 -05:00
|
|
|
- name: Build Docker Image
|
|
|
|
shell: bash
|
2020-11-13 14:32:18 -05:00
|
|
|
run: |
|
2024-03-13 19:26:48 -04:00
|
|
|
# Single platform builds in pull_request context to speed things up
|
2024-02-28 09:10:06 -05:00
|
|
|
if [ "${{ github.event_name }}" = "push" ]; then
|
2024-03-13 19:26:48 -04:00
|
|
|
PLATFORM_ARG="--platform linux/arm64 --platform linux/amd64"
|
2024-02-28 09:10:06 -05:00
|
|
|
elif [ "${{ github.event_name }}" = "pull_request" ]; then
|
2024-03-13 19:26:48 -04:00
|
|
|
PLATFORM_ARG="--platform linux/amd64"
|
2024-02-28 09:10:06 -05:00
|
|
|
fi
|
2024-03-13 19:26:48 -04:00
|
|
|
|
|
|
|
supersetbot docker \
|
|
|
|
--preset ${{ matrix.build_preset }} \
|
|
|
|
--context "$EVENT" \
|
|
|
|
--context-ref "$RELEASE" $FORCE_LATEST \
|
|
|
|
$PLATFORM_ARG
|