Skip to content

Deploy for EC-CUBE

Deploy for EC-CUBE #50

Workflow file for this run

name: Deploy for EC-CUBE
on:
release:
types: [ published ]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout
uses: actions/checkout@master
- name: Setup PHP
uses: nanasess/setup-php@master
with:
php-version: '8.1'
- name: Install to Composer
run: composer install --no-scripts --no-dev --no-interaction --optimize-autoloader
- name: Translate to templates
run: php bin/template_jp.php
- name: Setup to EC-CUBE
env:
APP_ENV: 'prod'
DATABASE_URL: postgres://postgres:[email protected]:5432/eccube_db
DATABASE_SERVER_VERSION: 14
run: |
rm -rf $GITHUB_WORKSPACE/app/Plugin/*
echo "APP_ENV=${APP_ENV}" > .env
bin/console doctrine:database:create --env=dev
bin/console doctrine:schema:create --env=dev
bin/console eccube:fixtures:load --env=dev
- name: Install Plugins
env:
APP_ENV: 'prod'
DATABASE_URL: postgres://postgres:[email protected]:5432/eccube_db
DATABASE_SERVER_VERSION: 14
run: |
bin/console eccube:composer:require "ec-cube/recommend42"
bin/console eccube:composer:require "ec-cube/coupon42"
bin/console eccube:composer:require "ec-cube/mailmagazine42"
bin/console eccube:composer:require "ec-cube/salesreport42"
bin/console eccube:composer:require "ec-cube/relatedproduct42"
bin/console eccube:composer:require "ec-cube/securitychecker42"
bin/console eccube:composer:require "ec-cube/productreview42"
bin/console eccube:composer:require "ec-cube/api42"
bin/console eccube:composer:require "ec-cube/sitekit42"
- name: revert to config platform.php
run: composer config platform.php 8.1.0
- name: Pre Install Plugins
env:
PGPASSWORD: 'password'
run: psql eccube_db -h 127.0.0.1 -U postgres -c "select id,name,code,0 as enabled,version,source,0 as initialized,'2021-08-13 00:00:00' as create_date,'2021-08-13 00:00:00' as update_date,discriminator_type from dtb_plugin;" -A -F, --pset footer > src/Eccube/Resource/doctrine/import_csv/ja/dtb_plugin.csv
- name: Packaging
working-directory: ../
env:
TAG_NAME: ${{ github.event.release.tag_name }}
run: ${{ github.event.repository.name }}/package.sh
- name: Upload binaries to release of TGZ
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.tar.gz
asset_name: eccube-${{ github.event.release.tag_name }}.tar.gz
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of ZIP
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.zip
asset_name: eccube-${{ github.event.release.tag_name }}.zip
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of TGZ md5 checksum
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.md5
asset_name: eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.md5
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of TGZ sha1 checksum
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.sha1
asset_name: eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.sha1
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of TGZ sha256 checksum
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.sha256
asset_name: eccube-${{ github.event.release.tag_name }}.tar.gz.checksum.sha256
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of ZIP md5 checksum
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.zip.checksum.md5
asset_name: eccube-${{ github.event.release.tag_name }}.zip.checksum.md5
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of ZIP sha1 checksum
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.zip.checksum.sha1
asset_name: eccube-${{ github.event.release.tag_name }}.zip.checksum.sha1
tag: ${{ github.ref }}
overwrite: true
- name: Upload binaries to release of ZIP sha256 checksum
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ runner.workspace }}/eccube-${{ github.event.release.tag_name }}.zip.checksum.sha256
asset_name: eccube-${{ github.event.release.tag_name }}.zip.checksum.sha256
tag: ${{ github.ref }}
overwrite: true