dpgaspar commented on code in PR #26698:
URL: https://github.com/apache/superset/pull/26698#discussion_r1461739947
##########
.github/workflows/docker.yml:
##########
@@ -1,12 +1,15 @@
-name: Docker
+name: Build
on:
+ release:
+ types: [ published ]
push:
branches:
- 'master'
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
Review Comment:
Just a comment: `pull_request` trigger will use the PR SHA and run any
changes made on any PR. PRs from forks don't contain secrets
##########
.github/workflows/docker.yml:
##########
@@ -21,33 +24,249 @@ jobs:
echo "has-secrets=1" >> "$GITHUB_OUTPUT"
echo "has secrets!"
else
- echo "has-secrets=0" >> "$GITHUB_OUTPUT"
echo "no secrets!"
fi
- docker-build:
+
+ build-lean-image:
+ name: ${{ matrix.image.version }} lean image
needs: config
- if: needs.config.outputs.has-secrets
- name: docker-build
runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ image:
+ - {version: "3.9-slim-bookworm", suffix: ""}
+ - {version: "3.10-slim-bookworm", suffix: "-py310"}
steps:
- - name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
- uses: actions/checkout@v3
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ persist-credentials: false
+ - name: Docker meta
+ id: meta
+ uses: docker/metadata-action@v5
+ with:
+ images: ${{ github.repository }}
+ flavor: |
+ latest=false
+ suffix=${{ matrix.image.suffix }}
+ tags: |
+ type=sha,prefix=,format=long
+ type=ref,event=pr
+ type=raw,value=master,enable={{is_default_branch}}
+ type=raw,value=latest,enable={{is_default_branch}}
+ type=pep440,pattern={{version}}
+ labels: |
+ target=lean
+ build_actor=${{ github.actor }}
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+ - name: Build
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ platforms: linux/amd64
+ load: true
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
+ target: lean
+ build-args: |
+ PY_VER=${{ matrix.image.version }}
+ - name: Login to Docker Hub
+ if: needs.config.outputs.has-secrets
+ uses: docker/login-action@v3
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
Review Comment:
this is `secrets.DOCKERHUB_USER`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]