Skip to content

Commit

Permalink
Workflow for publishing base images (#186)
Browse files Browse the repository at this point in the history
* Workflow for publishing base images
  • Loading branch information
crohr authored May 30, 2024
1 parent 9ce9f63 commit 35b3d49
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 73 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:

strategy:
matrix:
os: ["ubuntu-18.04", "ubuntu-20.04"]
ruby: ["1.9", "2.1", "2.2", "2.3", "2.4", "2.6", "2.7", "3.0"]
os: ["ubuntu-22.04"]
ruby: ["2.7", "3.0", "3.3"]

steps:
- uses: actions/checkout@v2
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish pkgr images

on:
workflow_dispatch:
push:
branches:
- base-images

jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- debian:10
- debian:11
- debian:12
- ubuntu:20.04
- ubuntu:22.04
- ubuntu:24.04
- el:7
- el:8
- el:9
- sles:12
- sles:15

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: images/Dockerfile.template
push: true
tags: |
ghcr.io/${{ github.repository }}/${{ matrix.target }}-${{ github.sha }}
build-args: |
PKGR_VERSION=${{ github.sha }}
TARGET=${{ matrix.target }}
5 changes: 3 additions & 2 deletions images/el/8/Dockerfile → images/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM barebuild/el:8
WORKDIR /app
ARG TARGET
FROM barebuild/$TARGET
ARG PKGR_VERSION

WORKDIR /app
RUN curl -GLs https://buildcurl.com -d recipe=pkgr -d version="$PKGR_VERSION" -d target="$TARGET" -o - | tar xzf - -C /usr/local
ENTRYPOINT ["/usr/local/bin/pkgr", "package", ".", "--clean", "--auto", "--compile-cache-dir", "/cache"]
15 changes: 0 additions & 15 deletions images/Makefile

This file was deleted.

6 changes: 0 additions & 6 deletions images/debian/10/Dockerfile

This file was deleted.

18 changes: 0 additions & 18 deletions images/dockerize

This file was deleted.

6 changes: 0 additions & 6 deletions images/el/7/Dockerfile

This file was deleted.

18 changes: 0 additions & 18 deletions images/push

This file was deleted.

6 changes: 0 additions & 6 deletions images/ubuntu/20.04/Dockerfile

This file was deleted.

0 comments on commit 35b3d49

Please sign in to comment.