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

Deployment workflow PS 9 #1305

Open
wants to merge 1 commit into
base: prestashop/9.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading