Skip to content

Nightly Build Containers #54

Nightly Build Containers

Nightly Build Containers #54

Workflow file for this run

---
name: Nightly Build Containers
on:
workflow_dispatch:
schedule:
- cron: "1 14 * * *"
defaults:
run:
shell: bash
jobs:
nightly:
name: Cassandra Nightly
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: "Get docker info"
run: |
echo "Actor: ${{ github.actor }}"
echo "REPO_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "TIMESTAMP=$(date +'%s')" >> $GITHUB_ENV
- name: "Log into GitHub Container Registry"
if: "github.event_name != 'pull_request'"
uses: "docker/login-action@v1"
with:
registry: "ghcr.io"
username: "${{ github.actor }}"
password: "${{ secrets.GITHUB_TOKEN }}"
- name: Prepare AxonOps Workbench Dockerfile
id: setup
run: |
cp axonops-entrypoint.sh cassandra/5.1-nightly
- name: Build the Apache Cassandra image
uses: docker/build-push-action@v4
id: build
with:
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=5.1-SNAPSHOT
GitCommit=${{ github.sha }}
MAJOR_VERSION=5.1
context: cassandra/5.1-nightly
push: true
pull: true
sbom: true
cache-from: ghcr.io/${{ env.REPO_OWNER }}/cassandra:latest
file: cassandra/5.1-nightly/Dockerfile
tags: |
ghcr.io/${{ env.REPO_OWNER }}/cassandra:latest
labels: |
LABEL org.opencontainers.image.source="https://github.com/${{ env.REPO_OWNER }}/axonops-workbench-containers"
- name: Generate manitest
run: |
mkdir -p manifests/cassandra/docker
REPO=ghcr.io/${{ env.REPO_OWNER }}/cassandra:latest
jq -n \
--argjson "${{ env.TIMESTAMP }}" "$(jq -n --arg digest '${{ steps.build.outputs.digest }}' --arg tag 'latest' --arg repo "$REPO" '$ARGS.named')" \
'$ARGS.named' > manifests/cassandra/docker/latest.json
jq -s 'reduce .[] as $item ({}; .cassandra.docker += $item)' manifests/cassandra/docker/*.json > manifest.json
- name: Commit manifest
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git pull
git add manifests manifest.json
if [ $(git status --porcelain | wc -l) -eq "0" ]; then
echo "No changes to commit"
exit 0
fi
git commit -m "Add nightly manifest [skip ci]"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}