Skip to content

Workflow file for this run

name: Docker image build CI - build docker image.
on:
release:
types: [ published ]
jobs:
build-docker-image:
name: Build and push SDK semver release docker images
runs-on: ubuntu-22.04
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2
# Multi-platform set up.
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
# https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# https://github.com/docker/build-push-action
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
file: ./infrastructure/sdk.Dockerfile
platforms: linux/amd64, linux/arm64
push: true
tags: spryker/php-sdk:${{ github.event.release.tag_name }},spryker/php-sdk:latest
labels: Release ${{ github.event.release.tag_name }}
build-sprykerci-image:
name: Build and push docker image for SprykerCI PHP ${{ matrix.php_version }}
runs-on: ubuntu-22.04
needs: build-docker-image
strategy:
matrix:
php_version: ['8.1', '8.2', '8.3']
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2
# https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# https://github.com/docker/build-push-action
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
file: ./infrastructure/sdk.sprykerci-${{ matrix.php_version }}.Dockerfile
platforms: linux/amd64
push: true
tags: spryker/php-sdk:sprykerci-${{ matrix.php_version }}
labels: SprykerCI
build-sprykerci-default-image:
name: Build and push docker image for SprykerCI PHP 8.1
runs-on: ubuntu-22.04
needs: build-docker-image
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2
# https://github.com/docker/login-action
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# https://github.com/docker/build-push-action
- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
file: ./infrastructure/sdk.sprykerci-8.1.Dockerfile
platforms: linux/amd64
push: true
tags: spryker/php-sdk:sprykerci
labels: SprykerCI
installer:
name: Create and publish Spryker SDK installer
runs-on: ubuntu-22.04
needs: build-docker-image
steps:
# https://github.com/actions/checkout
- name: Checkout codebase
uses: actions/checkout@v2
# Get details of the latest release.
- name: Get latest release
id: latest_release
uses: kaliber5/action-get-release@v1
with:
token: ${{ github.token }}
latest: true
# Build `installer.sh` script. The result script will be placed into `./build` directory.
- name: Run installer creation
shell: bash
run: |
./infrastructure/installer_builder.sh ${{ github.event.release.tag_name }}
# Uploads `installer.sh` script. Requires `upload_url` from the `latest_release` step.
- name: Upload installer.sh
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.latest_release.outputs.upload_url }}
asset_path: ./build/installer.sh
asset_name: installer.sh
asset_content_type: text/x-shellscript
trigger-sprykerci:
name: Triggers SprykerCI post-release pipeline
runs-on: ubuntu-22.04
needs: [ build-sprykerci-image, build-sprykerci-default-image, installer ]
steps:
- name: Trigger CI pipeline
shell: bash
run: |
curl -X POST https://eu.buddy.works/paas-demo/sdk/pipelines/pipeline/181690/trigger-webhook?token=${{ secrets.EXTERNAL_CI_HOOK_TOKEN }}