71 lines
2.0 KiB
YAML
71 lines
2.0 KiB
YAML
name: Build-Publish
|
|
run-name: Build and publish infmap Docker image
|
|
|
|
on: [push]
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- linux/amd64
|
|
- linux/arm64
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Login to Gitea
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.jde.nz
|
|
username: DoesntMatter
|
|
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
|
|
|
|
- name: Build
|
|
run: |
|
|
ARCH=$(uname -m)
|
|
docker build --provenance=false -t gitea.jde.nz/public/infmap:latest-${ARCH} ./app
|
|
|
|
- name: Publish
|
|
run: |
|
|
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
|
|
ARCH=$(uname -m)
|
|
docker push gitea.jde.nz/public/infmap:latest-${ARCH}
|
|
fi
|
|
|
|
create-manifest:
|
|
needs: [build]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Login to Gitea
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.jde.nz
|
|
username: DoesntMatter
|
|
password: ${{ secrets.DOCKER_PUSH_TOKEN }}
|
|
|
|
- name: Create and push manifest list
|
|
run: |
|
|
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
|
|
docker manifest rm gitea.jde.nz/public/infmap:latest 2>/dev/null || true
|
|
|
|
docker manifest create gitea.jde.nz/public/infmap:latest \
|
|
--amend gitea.jde.nz/public/infmap:latest-x86_64 \
|
|
--amend gitea.jde.nz/public/infmap:latest-aarch64
|
|
|
|
docker manifest annotate gitea.jde.nz/public/infmap:latest \
|
|
gitea.jde.nz/public/infmap:latest-x86_64 --arch amd64
|
|
|
|
docker manifest annotate gitea.jde.nz/public/infmap:latest \
|
|
gitea.jde.nz/public/infmap:latest-aarch64 --arch arm64
|
|
|
|
docker manifest push gitea.jde.nz/public/infmap:latest
|
|
|
|
echo "Manifest list created and pushed successfully"
|
|
fi
|