fix: remove non-root user from the base library/ubuntu image (#874) #354
This file contains 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: Build & Push Core images | |
on: | |
push: | |
branches: | |
- "master" | |
paths: | |
- "dockerfiles/*_devel.Dockerfile" | |
workflow_run: | |
workflows: | |
- "Create new release" | |
branches: | |
- "master" | |
types: | |
- completed | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
generate_matrix: | |
runs-on: ubuntu-latest | |
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
all-versions: ${{ steps.set-json.outputs.all-versions }} | |
steps: | |
- uses: actions/checkout@v4.1.4 | |
- id: set-json | |
run: | | |
JSON=build/matrix/latest.json | |
ALL=false | |
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then | |
JSON=build/matrix/all.json | |
ALL=true | |
fi | |
echo "json=${JSON}" >>"$GITHUB_OUTPUT" | |
echo "all-versions=${ALL}" >>"$GITHUB_OUTPUT" | |
echo ${JSON} | |
- id: set-matrix | |
run: | | |
CONTENT=$(jq -r 'tostring' ${{ steps.set-json.outputs.json }}) | |
echo "matrix=${CONTENT}" >>"$GITHUB_OUTPUT" | |
echo "${CONTENT}" | |
build: | |
needs: generate_matrix | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix)}} | |
steps: | |
- uses: actions/checkout@v4.1.4 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push Docker images | |
run: | | |
BAKE_JSON=bakefiles/${{ matrix.r_version }}.docker-bake.json \ | |
BAKE_GROUP=${{ matrix.group }} \ | |
BAKE_OPTION=--push \ | |
make bake-json-group | |
call-extra-workflow: | |
needs: | |
- generate_matrix | |
- build | |
uses: ./.github/workflows/extra.yml | |
with: | |
all-versions: ${{ needs.generate_matrix.outputs.all-versions == 'true' }} |