fix: Fixed PATH definition so cloudcontrol.sh finds markdown #185
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Build Images" | |
on: | |
push: | |
release: | |
types: | |
- published | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build: | |
if: "github.event.head_commit.message != 'chore: storing version and changelog'" | |
strategy: | |
matrix: | |
flavour: | |
- name: aws | |
platforms: "linux/amd64,linux/arm64" | |
- name: azure | |
platforms: "linux/amd64,linux/arm64" | |
- name: gcloud | |
platforms: "linux/amd64,linux/arm64" | |
- name: simple | |
platforms: "linux/amd64,linux/arm64" | |
- name: tanzu | |
platforms: "linux/amd64" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install cosign | |
uses: sigstore/cosign-installer@v3.5.0 | |
# Set up QEMU to be able to build to multiple architectures | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@v2.4.0 | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@v2.1.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v4.3.0 | |
with: | |
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ matrix.flavour.name }} | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=edge,branch=develop | |
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }} | |
- name: Prepare build | |
id: prepare | |
run: | | |
export BUILD_DATE=$(date -Iseconds) | |
export FLAVOUR=${{ matrix.flavour.name }} | |
cat build/Dockerfile.prefix > Dockerfile | |
cat "flavour/${{ matrix.flavour.name }}/Dockerfile.flavour" >> Dockerfile | |
# Download mo | |
curl -sSL https://raw.githubusercontent.com/tests-always-included/mo/master/mo -o mo | |
chmod +x mo | |
cat build/Dockerfile.suffix.mo | ./mo > build/Dockerfile.suffix | |
cat build/Dockerfile.suffix >> Dockerfile | |
{ | |
echo 'labels<<EOF' | |
cat build/labels.txt.mo | ./mo | sed -re "s/^/ /gm" # Add whitespace to insert it as annotations | |
echo EOF | |
} >> "$GITHUB_OUTPUT" | |
rm mo | |
env: | |
FLAVOUR: "${{ matrix.flavour.name }}" | |
- name: Clean up Docker | |
run: | | |
docker system prune -f --filter "until=5h" | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v5.3.0 | |
with: | |
context: . | |
push: true | |
pull: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
annotations: | | |
${{ steps.prepare.outputs.labels }} | |
no-cache: true | |
platforms: ${{ matrix.flavour.platforms }} | |
- name: Sign the published Docker image | |
run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign --yes {}@${{ steps.build-and-push.outputs.digest }} |