58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
name: Publish CPU Image
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
paths-ignore:
|
|
- "**.md"
|
|
- "docs/**"
|
|
- ".github/workflows/release.yml"
|
|
- ".github/workflows/lint.yml"
|
|
- ".github/dependabot.yml"
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Free up disk space
|
|
run: |
|
|
sudo rm -rf /usr/share/dotnet
|
|
sudo rm -rf /opt/ghc
|
|
sudo rm -rf "/usr/local/share/boost"
|
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
echo "Disk space freed."
|
|
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to GHCR
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build and push CPU image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
target: runtime-cpu
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: ghcr.io/sudolulo/if-curator-headless:latest
|
|
cache-from: type=gha,scope=cpu
|
|
cache-to: type=gha,mode=max,scope=cpu
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|