From 91d71846e7480c199d055fc7c743cc46a97d5732 Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Thu, 6 Feb 2025 13:56:36 +0200 Subject: [PATCH 1/2] Added testing release workflow --- .github/workflows/deploy-production.yml | 51 +++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/deploy-production.yml diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml new file mode 100644 index 000000000..400721956 --- /dev/null +++ b/.github/workflows/deploy-production.yml @@ -0,0 +1,51 @@ +name: Deploy to Production + +on: + release: + types: [created, edited, released] + +jobs: + push-to-repository: + name: PRODUCTION - Create module zip + strategy: + fail-fast: false + uses: ./.github/workflows/push-to-repository.yml + with: + env-upper: PRODUCTION + env-lower: production + triggered: true + zip-name: ${{ github.event.repository.name }}.zip + repository-name: ${{ github.event.repository.name }} + secrets: inherit + + update-release-draft: + name: PRODUCTION - Update release draft + runs-on: ubuntu-latest + environment: production + permissions: + id-token: write + contents: write + pull-requests: write + env: + ZIP_NAME: ${{ github.event.repository.name }}.zip + + steps: + - name: Download artifact 🚚 + uses: actions/download-artifact@v4 + with: + name: ${{ env.ZIP_NAME }} + + - name: Prepare zip for release 👷 + run: | + cd ${{ inputs.repository-name }} + zip -r ../${{ env.ZIP_NAME }} . -x '*.DS_Store*' '*.git*' '*/.php_cs.*' '*__MACOSX*' '*/node_modules' '*/.npmrc' '*/composer.*' '*/package.*' '*/.editorconfig' '*_dev*' '*test*' '*/tests/*' '*/Test/*' '*/Tests/*' '*/gha-creds-*.json' + + - name: Publish to GitHub Release 🛩ī¸ + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./${{ env.ZIP_NAME }} + asset_name: ${{ env.ZIP_NAME }} + asset_content_type: application/zip From 8a7c7e09ecf2a0de377606bcdf28b1dcb49556b7 Mon Sep 17 00:00:00 2001 From: L3RAZ Date: Fri, 7 Feb 2025 14:37:28 +0200 Subject: [PATCH 2/2] Updated second job to depend on first --- .github/workflows/deploy-production.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml index 400721956..d7500b339 100644 --- a/.github/workflows/deploy-production.yml +++ b/.github/workflows/deploy-production.yml @@ -20,6 +20,7 @@ jobs: update-release-draft: name: PRODUCTION - Update release draft + needs: push-to-repository runs-on: ubuntu-latest environment: production permissions: