Skip to content

Updated docs

Updated docs #7

Workflow file for this run

name: publish
on:
schedule:
- cron: '38 02,08,14,20 * * *'
push:
branches: ["main"]
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash -leoux pipefail {0}
jobs:
docker:
runs-on: ubuntu-latest
concurrency: ci-${{ github.ref }}
steps:
- name: Checkout
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: Login into registry
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
load: true
tags: ghcr.io/${{ github.repository }}:test
- name: Check if changed
id: checkchanged
run: |
mkdir tmp
cd tmp
if docker pull --platform linux/amd64 ghcr.io/${{ github.repository }}:latest; then
img=$(docker create --platform linux/amd64 ghcr.io/${{ github.repository }}:latest)
docker export $img -o latest.tar
docker rm $img
img=$(docker create --platform linux/amd64 ghcr.io/${{ github.repository }}:test)
docker export $img -o test.tar
docker rm $img
mkdir test
mkdir latest
tar xf test.tar -C test --exclude={var/{log,cache},lib/apk/db/scripts.tar}
tar xf latest.tar -C latest --exclude={var/{log,cache},lib/apk/db/scripts.tar}
if diff -q -r --no-dereference test latest; then
echo "CHECKEQUALS=true" >> "$GITHUB_OUTPUT"
fi
fi
- name: Build and push
uses: docker/build-push-action@v5
if: github.event_name == 'workflow_dispatch' || github.event_name != 'pull_request' && steps.checkchanged.outputs.CHECKEQUALS != 'true'
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: ${{ github.event_name != 'pull_request' }}
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:1