Skip to content

[PAYSHIP-3115] Deployment workflow PS 8 #34

[PAYSHIP-3115] Deployment workflow PS 8

[PAYSHIP-3115] Deployment workflow PS 8 #34

Workflow file for this run

name: PrestaShop 8 - Deployment
on:
pull_request:
types: [opened, reopened, synchronize, edited, labeled]
push:
tags:
- v8.*
branches:
- prestashop/8.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: ps8
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: ps8
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