Skip to content

Build Shopware

Build Shopware #38

Workflow file for this run

name: Build Shopware
on:
workflow_dispatch:
push:
paths:
- images/6/**
jobs:
build:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- runner: ubuntu-latest
arch: amd64
- runner: buildjet-2vcpu-ubuntu-2204-arm
arch: arm64
steps:
- name: Clone
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Get latest version
run: |
VERSION=$(curl -s https://api.github.com/repos/shopware/shopware/releases/latest | jq -r .tag_name | sed 's/^.//')
TAG=$(echo $VERSION | tr . ' ' | awk '{print $1 "." $2 "." $3}')
echo "version=$VERSION" >> $GITHUB_ENV
echo "tag=$TAG" >> $GITHUB_ENV
- uses: docker/build-push-action@v4
with:
tags: ghcr.io/shopwarelabs/testenv:${{ env.tag }}-${{ matrix.arch }}
build-args: |
SHOPWARE_VERSION=${{ env.version }}
context: images/6
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
provenance: false
merge-manifest:
name: Merge Manifest
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Get latest version
run: |
VERSION=$(curl -s https://api.github.com/repos/shopware/shopware/releases/latest | jq -r .tag_name | sed 's/^.//')
TAG=$(echo $VERSION | tr . ' ' | awk '{print $1 "." $2 "." $3}')
echo "version=$VERSION" >> $GITHUB_ENV
echo "tag=$TAG" >> $GITHUB_ENV
- run: docker manifest create ghcr.io/shopwarelabs/testenv:${{ env.tag }} --amend ghcr.io/shopwarelabs/testenv:${{ env.tag }}-amd64 --amend ghcr.io/shopwarelabs/testenv:${{ env.tag }}-arm64
- run: docker manifest push ghcr.io/shopwarelabs/testenv:${{ env.tag }}