-
Notifications
You must be signed in to change notification settings - Fork 719
155 lines (144 loc) · 7.19 KB
/
Copy pathdeploy.yml
File metadata and controls
155 lines (144 loc) · 7.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Deploy for EC-CUBE
on:
release:
types: [ published ]
permissions: {}
jobs:
deploy:
permissions:
contents: write
name: Deploy
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6
with:
persist-credentials: false
## Docker Hub からの pull はタイムアウトで CI が不安定になるため、
## DB はコンテナではなく setup アクション (apt) でインストールする
- name: Setup PostgreSQL
uses: ankane/setup-postgres@6d3ffa1aa7498a42b79e9f9f5838b99971839300 # v1
with:
postgres-version: '18'
user: postgres
- name: Configure PostgreSQL
run: |
for _ in $(seq 1 30); do pg_isready -h 127.0.0.1 && break; sleep 1; done
pg_isready -h 127.0.0.1 || { echo 'PostgreSQL did not become ready within 30s'; exit 1; }
psql -h 127.0.0.1 -U postgres -c "ALTER USER postgres PASSWORD 'password'"
## DATABASE_URL と同一経路 (TCP/postgres/password) で接続できることを検証
PGPASSWORD=password psql -h 127.0.0.1 -U postgres -c 'SELECT VERSION()'
- name: Setup PHP
uses: nanasess/setup-php@6e78a56349ee2b751525bdbc0905e07293007bb4 # master
with:
php-version: '8.5'
- name: Install ext-redis 6.1+
run: |
sudo apt-get update
sudo apt-get install -y php8.4-redis
sudo phpenmod -s cli redis
php -m | grep -i redis
- 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:password@127.0.0.1:5432/eccube_db
DATABASE_SERVER_VERSION: 18
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:password@127.0.0.1:5432/eccube_db
DATABASE_SERVER_VERSION: 18
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"
- name: revert to config platform.php
run: composer config platform.php 8.4.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@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
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@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
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@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
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@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
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@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
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@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
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@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
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@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
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