chore(deps): Bump rust from 1.92-slim to 1.93-slim in /docker (#44) #20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Execution Env Build and Publish | |
| on: | |
| push: | |
| branches: ["main", "dev"] | |
| paths: | |
| - "docker/**" | |
| - ".github/workflows/execution-env-publish.yml" | |
| workflow_dispatch: | |
| inputs: | |
| build_all: | |
| description: 'Force build all images' | |
| type: boolean | |
| default: false | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_BASE: ${{ github.repository }} | |
| ALL_LANGUAGES: '["python", "nodejs", "go", "java", "c-cpp", "php", "rust", "fortran", "r", "d"]' | |
| jobs: | |
| filter: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| changes: ${{ steps.determine-targets.outputs.languages }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: changes | |
| with: | |
| filters: | | |
| rebuild_all: | |
| - '.github/workflows/execution-env-publish.yml' | |
| - 'docker/entrypoint.sh' | |
| python: | |
| - 'docker/python.Dockerfile' | |
| - 'docker/repl_server.py' | |
| - 'docker/requirements/**' | |
| nodejs: | |
| - 'docker/nodejs.Dockerfile' | |
| go: | |
| - 'docker/go.Dockerfile' | |
| java: | |
| - 'docker/java.Dockerfile' | |
| c-cpp: | |
| - 'docker/c-cpp.Dockerfile' | |
| php: | |
| - 'docker/php.Dockerfile' | |
| rust: | |
| - 'docker/rust.Dockerfile' | |
| fortran: | |
| - 'docker/fortran.Dockerfile' | |
| r: | |
| - 'docker/r.Dockerfile' | |
| d: | |
| - 'docker/d.Dockerfile' | |
| - name: Determine targets | |
| id: determine-targets | |
| run: | | |
| if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${{ github.event.inputs.build_all }}" == "true" ]; then | |
| echo 'languages=${{ env.ALL_LANGUAGES }}' >> $GITHUB_OUTPUT | |
| elif [ "${{ steps.changes.outputs.rebuild_all }}" == "true" ]; then | |
| # If workflow or shared files changed, build everything | |
| echo 'languages=${{ env.ALL_LANGUAGES }}' >> $GITHUB_OUTPUT | |
| else | |
| # Filter out rebuild_all from the changes list | |
| CHANGES='${{ steps.changes.outputs.changes }}' | |
| FILTERED=$(echo "$CHANGES" | jq -c '[.[] | select(. != "rebuild_all")]') | |
| echo "languages=$FILTERED" >> $GITHUB_OUTPUT | |
| fi | |
| build-images: | |
| needs: filter | |
| if: ${{ needs.filter.outputs.changes != '[]' && needs.filter.outputs.changes != '' }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| language: ${{ fromJSON(needs.filter.outputs.changes) }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log into registry ${{ env.REGISTRY }} | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract Docker metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| # Image name format: ghcr.io/owner/repo/python | |
| images: ${{ env.REGISTRY }}/${{ env.IMAGE_BASE }}/${{ matrix.language }} | |
| tags: | | |
| type=ref,event=branch | |
| type=semver,pattern={{version}} | |
| type=sha,format=long | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| - name: Build and push ${{ matrix.language }} image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: docker | |
| file: docker/${{ matrix.language }}.Dockerfile | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: | | |
| BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') |