75 lines
2.2 KiB
YAML
75 lines
2.2 KiB
YAML
name: dropshell-build multiarch
|
|
run-name: Build test and publish dropshell-build
|
|
|
|
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 Base
|
|
run: |
|
|
cd build-base && ./build.sh
|
|
- name: Build Test Applications
|
|
run: |
|
|
cd tests && ./build.sh
|
|
- name: Run Tests
|
|
run: |
|
|
cd tests && ./test.sh
|
|
- name: Publish as Latest
|
|
run: |
|
|
# Only publish on main branch
|
|
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
|
|
cd build-base && \
|
|
SOS_WRITE_TOKEN=${{ secrets.SOS_WRITE_TOKEN }} \
|
|
DOCKER_PUSH_TOKEN=${{ secrets.DOCKER_PUSH_TOKEN }} \
|
|
./publish.sh
|
|
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: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y jq
|
|
|
|
- name: Create and push manifest list
|
|
run: |
|
|
# Only create manifest on main branch
|
|
if [ "$GITHUB_REF" = "refs/heads/main" ]; then
|
|
# Create the manifest list using the architecture-specific digests
|
|
docker manifest create gitea.jde.nz/public/dropshell-build-base:latest \
|
|
--amend gitea.jde.nz/public/dropshell-build-base:latest-x86_64 \
|
|
--amend gitea.jde.nz/public/dropshell-build-base:latest-aarch64
|
|
|
|
# Push the manifest list
|
|
docker manifest push gitea.jde.nz/public/dropshell-build-base:latest
|
|
|
|
echo "Manifest list created and pushed successfully"
|
|
fi
|