-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49a7c06
commit 89ed570
Showing
3 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: build image | ||
on: | ||
pull_request: | ||
paths: | ||
- "base.dockerfile" | ||
- ".github/workflows/base.yaml" | ||
push: | ||
paths: | ||
- "base.dockerfile" | ||
- ".github/workflows/base.yaml" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/oomol/base-rootfs | ||
tags: | | ||
type=sha | ||
type=raw,value=latest,enable={{is_default_branch}} | ||
type=semver,pattern={{version}} | ||
flavor: | | ||
latest=auto | ||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
push: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') || github.ref_type == 'tag' }} | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
file: base.dockerfile | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: export rootfs | ||
run: | | ||
docker run -d --name rootfs-export ${{ steps.meta.outputs.images }} | ||
docker export rootfs-export > base-rootfs-amd64.tar | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: base-rootfs-amd64.tar | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag_name: ${{ github.sha }} | ||
body: ${{ github.sha }} | ||
draft: false | ||
prerelease: false | ||
make_latest: true |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM ubuntu:latest | ||
|
||
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \ | ||
--mount=target=/var/cache/apt,type=cache,sharing=locked \ | ||
rm -f /etc/apt/apt.conf.d/docker-clean \ | ||
&& apt update \ | ||
&& apt install -y --no-install-recommends locales-all tar xz-utils uuid-runtime |