Publish builder packages from AUR in Gitpod #714
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: Publish builder packages from AUR in Gitpod | |
on: | |
push: | |
branches: [main] | |
paths: | |
- src/Docker/AUR.Dockerfile | |
pull_request: | |
branches: [main] | |
schedule: | |
- cron: "0 4 * * *" | |
jobs: | |
push_image: | |
runs-on: ubuntu-25.04 | |
steps: | |
- name: Partial Clone | |
shell: bash | |
run: | | |
REPO="https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" | |
git config --global user.email github-actions@github.com | |
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-aur-cache | |
key: ${{ runner.os }}-buildx-aur-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx-aur- | |
- 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/AUR.Dockerfile | |
platforms: linux/amd64 | |
push: true | |
tags: ghcr.io/cpp-review-dune/introductory-review/aur:latest | |
cache-from: type=local,src=/tmp/.buildx-aur-cache | |
cache-to: type=local,mode=max,dest=/tmp/.buildx-main-cache | |
- name: Move cache | |
run: | | |
rm -rf /tmp/.buildx-aur-cache | |
mv /tmp/.buildx-main-cache /tmp/.buildx-aur-cache | |
# - name: Scan for vulnerabilities | |
# uses: crazy-max/ghaction-container-scan@master | |
# with: | |
# image: ghcr.io/cpp-review-dune/introductory-review/aur:latest | |
# annotations: true | |
# severity_threshold: CRITICAL | |
# dockerfile: ./src/Docker/AUR.Dockerfile | |
- name: Prune untagged images | |
uses: carlosal1015/ghcr-delete-image-action@main | |
with: | |
owner: cpp-review-dune | |
name: introductory-review/aur | |
token: ${{ secrets.PAT }} | |
untagged-keep-latest: 3 |