Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PAYSHIP-3106] Deployment workflow PS 1.7.x #1282

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
02fe0e1
Deployment workflow PS 1.7.x
seiwan Nov 15, 2024
8addbfc
Deployment workflow PS 1.7.x
seiwan Nov 15, 2024
0c1ecc4
Deployment workflow PS 1.7.x
seiwan Nov 15, 2024
18789b6
Deployment workflow PS 1.7.x
seiwan Nov 15, 2024
ce63778
Deployment workflow PS 1.7.x
seiwan Nov 15, 2024
0883d64
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
4bad90b
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
01108ff
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
6453cb3
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
084c768
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
41e6d91
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
ea89c15
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
8e49a36
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
8af9616
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
5c9f184
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
09dcf07
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
aaf202d
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
546e83d
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
8036db8
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
cb5b68c
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
3c60338
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
31e2891
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
c8e119d
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
8df04ee
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
d5e9397
Deployment workflow PS 1.7.x
seiwan Nov 18, 2024
e07bba0
Deployment workflow PS 1.7
seiwan Nov 19, 2024
93dbf28
Push zip files at GCP bucket storage root
seiwan Nov 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions .github/actions/auth-gcp/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: 'Auth GCP'
description: 'Auth gcp, can login to docker artifact registry or install the sdk'
inputs:
auth-mode:
description: 'Authentication mode (workload-federation or json-file)'
required: true
type: choice
options:
- workload-federation
- json-file
default: 'workload-federation'
registry-login:
required: false
type: bool
default: false
credentials-json:
required: false
type: string
setup-gcloud:
required: false
type: bool
default: false
service-account:
required: false
description: Service account email
type: string
provider:
required: false
description: gcp workload identity provider
type: string
gcp-registry-region:
required: false
description: docker registry gcp
default: "europe-west1-docker.pkg.dev"
type: string
sdk-version:
required: true
description: which version of google dsl you want to suer
default: '>=457.0.0'
type: string
gke-cluster-name:
required: false
description: 'If you put the cluster name in this variable it will activate auth to make kubectl'
default: ''
type: string
cluster-region:
required: false
description: 'Cluster region'
type: choice
options:
- europe-west1
default: 'europe-west1'

runs:
using: 'composite'
steps:
- name: Authenticate to Google Cloud with Workload Federation 🔐
if: ${{ inputs.auth-mode == 'workload-federation' }}
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ inputs.provider }}
service_account: ${{ inputs.service-account }}

- name: Authenticate to Google Cloud with a JSON file 🔐 (THIS IS DEPRECATED ❌)
if: ${{ inputs.auth-mode == 'json-file' }}
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ inputs.credentials-json }}

- name: Setting up gcloud SDK 🛠
if: ${{ inputs.setup-gcloud == 'true' }}
uses: google-github-actions/setup-gcloud@v2
with:
version: ${{ inputs.sdk-version }}

- name: Login to Docker artifact registry 🐳
if: ${{ inputs.registry-login == 'true' }}
shell: bash
run: gcloud auth configure-docker ${{ inputs.gcp-registry-region }}

- name: Add cluster authentification 🧊
if: ${{ inputs.gke-cluster-name != '' }}
uses: 'google-github-actions/get-gke-credentials@v2'
with:
cluster_name: '${{ inputs.gke-cluster-name }}'
location: '${{ inputs.cluster-region }}'
93 changes: 0 additions & 93 deletions .github/workflows/build-release.yml

This file was deleted.

99 changes: 99 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: PrestaShop 1.7 - Deployment

on:
pull_request:
types: [opened, reopened, synchronize, edited, labeled]
push:
tags:
- v7.*
branches:
- prestashop/1.7.x

jobs:
zip-name-matrix:
name: Generate zip file name
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
env:
- integration
- preproduction
outputs:
integration: ${{ steps.zip-name.outputs.integration }}
preproduction: ${{ steps.zip-name.outputs.preproduction }}
production: ${{ github.event.repository.name }}

steps:
- name: Generate zip file name
id: zip-name
run: |
date=$(date -d '+2 hours' +'%Y-%m-%d_%H-%M-%S')
echo "$ENV=$REPOSITORY-$PS_VERSION-$ENV-$PR_NUMBER-$date" >> "$GITHUB_OUTPUT"
env:
ENV: ${{ matrix.env }}
REPOSITORY: ${{ github.event.repository.name }}
PS_VERSION: ps7
PR_NUMBER: pr${{ github.event.number }}

push-to-repository-matrix:
name: ${{ matrix.env.upper }} - Push to GitHub repository
needs: [zip-name-matrix]
strategy:
fail-fast: false
matrix:
env:
- upper: INTEGRATION
lower: integration
triggered: ${{ contains(github.event.pull_request.labels.*.name, 'integration deployment') }}
- upper: PREPRODUCTION
lower: preproduction
triggered: ${{ contains(github.event.pull_request.labels.*.name, 'preproduction deployment') }}
- upper: PRODUCTION
lower: production
triggered: ${{ github.event_name == 'push' }}
uses: ./.github/workflows/push-to-repository.yml
with:
env-upper: ${{ matrix.env.upper }}
env-lower: ${{ matrix.env.lower }}
triggered: ${{ matrix.env.triggered }}
zip-name: ${{ needs.zip-name-matrix.outputs[matrix.env.lower] }}
repository-name: ${{ github.event.repository.name }}
secrets: inherit

push-to-bucket-matrix:
name: ${{ matrix.env.upper }} - Push to GCP bucket storage
needs: [zip-name-matrix, push-to-repository-matrix]
strategy:
fail-fast: false
matrix:
env:
- lower: integration
upper: INTEGRATION
triggered: ${{ contains(github.event.pull_request.labels.*.name, 'integration deployment') }}
- lower: preproduction
upper: PREPRODUCTION
triggered: ${{ contains(github.event.pull_request.labels.*.name, 'preproduction deployment') }}
- upper: PRODUCTION
lower: production
triggered: ${{ github.event_name == 'push' }}
uses: ./.github/workflows/push-to-bucket.yml
with:
env-upper: ${{ matrix.env.upper }}
env-lower: ${{ matrix.env.lower }}
triggered: ${{ matrix.env.triggered }}
zip-name: ${{ needs.zip-name-matrix.outputs[matrix.env.lower] }}
repository-name: ${{ github.event.repository.name }}
prestashop-version: ps7
pr-number: pr${{ github.event.number }}
secrets: inherit

update-release-draft:
name: PRODUCTION - Update release draft
needs: [push-to-repository-matrix]
uses: ./.github/workflows/update-release-draft.yml
with:
env-lower: production
triggered: ${{ github.event_name == 'push' }}
repository-name: ${{ github.event.repository.name }}
secrets: inherit
1 change: 1 addition & 0 deletions .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ jobs:
js-linter:
name: JS linter
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }}
steps:
- name: Checkout
uses: actions/[email protected]
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ name: PHP tests
on:
push:
branches:
- 'master'
- 'prestashop/1.7.x'
- "master"
- "prestashop/1.7.x"
pull_request:
types: [opened, reopened, synchronize, edited]

jobs:
header-stamp:
name: Check license headers
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }}
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup PHP 7.4
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: "7.4"

- name: Cache vendor folder
uses: actions/cache@v1
Expand All @@ -39,6 +40,7 @@ jobs:
php-linter:
name: PHP Syntax check 5.6|7.1|7.2|7.3|7.4
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }}
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -55,6 +57,7 @@ jobs:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }}
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -63,9 +66,10 @@ jobs:
phpstan:
name: PHPStan
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }}
strategy:
matrix:
presta-versions: ['1.7.0.3', '1.7.8.8']
presta-versions: ["1.7.0.3", "1.7.8.8"]
steps:
- name: Checkout
uses: actions/[email protected]
Expand All @@ -87,11 +91,12 @@ jobs:
- name: Pull PrestaShop files (Tag ${{ matrix.presta-versions }})
run: docker run -tid --rm -v ps-volume:/var/www/html --name temp-ps prestashop/prestashop:${{ matrix.presta-versions }}

- name : Run PHPStan
- name: Run PHPStan
run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.12 analyse --configuration=/web/module/tests/phpstan/phpstan-PS-1.7.neon --error-format github
phpunit:
name: PHPUnit
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'ready to review') }}
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
Loading
Loading