Skip to content

Commit

Permalink
make magento version configurable in GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix-bjoern committed Jun 24, 2022
1 parent a4c5311 commit 32ee247
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: CI

on: [push]

env:
MAGENTO_VERSION: "2.4.4"

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -29,11 +32,6 @@ jobs:

- name: Remove auth.json file
run: rm -f $GITHUB_WORKSPACE/.composer/auth.json

- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -49,7 +47,8 @@ jobs:

- name: Build and push
uses: docker/build-push-action@v3
if: github.ref == 'refs/heads/main'
with:
context: .
push: true
tags: phoenixmedia/magento2:${{ steps.extract_branch.outputs.branch }}
tags: phoenixmedia/magento2:${{ env.MAGENTO_VERSION }}
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ echo "Cleaning up existing files..."
rm -Rf .dockerignore .gitignore Dockerfile bin docker docker-compose.yml helm src

echo "Installing source files..."
docker run -t --rm -v $(pwd):/var/www/html -v $(pwd)/.composer:/root/.composer phoenixmedia/nginx-php:8.1 bash -c "./install.sh"
docker run -t --rm -e MAGENTO_VERSION=${MAGENTO_VERSION} -v $(pwd):/var/www/html -v $(pwd)/.composer:/root/.composer phoenixmedia/nginx-php:8.1 bash -c "./install.sh"
2 changes: 0 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash

MAGENTO_VERSION=2.4.4

echo "Installing latest Magento2 OpenSource..."
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=${MAGENTO_VERSION} src

Expand Down

0 comments on commit 32ee247

Please sign in to comment.