Skip to content

Commit

Permalink
Deployment workflow PS 9 (#1305)
Browse files Browse the repository at this point in the history
  • Loading branch information
seiwan authored Feb 11, 2025
1 parent dff2eda commit 1a4d8ed
Show file tree
Hide file tree
Showing 6 changed files with 331 additions and 221 deletions.
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 9 - Deployment

on:
pull_request:
types: [opened, reopened, synchronize, edited, labeled]
push:
tags:
- v9.*
branches:
- prestashop/9.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 }}.zip

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.zip" >> "$GITHUB_OUTPUT"
env:
ENV: ${{ matrix.env }}
REPOSITORY: ${{ github.event.repository.name }}
PS_VERSION: ps9
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: ps9
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
2 changes: 1 addition & 1 deletion .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PHP tests
on:
push:
pull_request:
types: [opened, reopened, synchronize, edited]
types: [opened, reopened, synchronize, edited, labeled]

jobs:
header-stamp:
Expand Down
220 changes: 0 additions & 220 deletions .github/workflows/ps8-build-release.yml

This file was deleted.

Loading

0 comments on commit 1a4d8ed

Please sign in to comment.