Skip to content

Publish Docker image based on test-user #81

Publish Docker image based on test-user

Publish Docker image based on test-user #81

Workflow file for this run

name: Publish Docker image based on test-user
on:
push:
branches: [main]
paths:
- src/Docker/test-user.Dockerfile
pull_request:
branches: [main]
schedule:
- cron: "0 13 * * 5"
jobs:
push_image:
runs-on: ubuntu-24.04
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 34000
remove-dotnet: "true"
remove-android: "true"
remove-haskell: "true"
remove-codeql: "true"
- name: Partial Clone
shell: bash
run: |
REPO="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git"
git config --global user.email [email protected]
git config --global user.name github-actions
git clone -q --filter=blob:none --no-checkout --depth=1 --sparse $REPO && cd introductory-review
git sparse-checkout set src/Docker
git checkout
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-test-user-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-test-user-
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.CR_PAT }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: ./introductory-review/src/Docker/test-user.Dockerfile
platforms: linux/amd64
push: true
tags: ghcr.io/cpp-review-dune/introductory-review/test-user:latest
cache-from: type=local,src=/tmp/.buildx-test-cache
cache-to: type=local,mode=max,dest=/tmp/.buildx-main-cache
- name: Move cache
run: |
rm -rf /tmp/.buildx-test-user-cache
mv /tmp/.buildx-main-cache /tmp/.buildx-test-user-cache
# - name: Scan for vulnerabilities
# uses: crazy-max/ghaction-container-scan@master
# with:
# image: ghcr.io/cpp-review-dune/introductory-review/test-user:latest
# annotations: true
# severity_threshold: CRITICAL
# dockerfile: ./src/Docker/test-user.Dockerfile
- name: Prune untagged images
uses: carlosal1015/ghcr-delete-image-action@main
with:
owner: cpp-review-dune
name: introductory-review/test-user
token: ${{ secrets.PAT }}
untagged-keep-latest: 2