v8.4.3.1 #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to Production | |
on: | |
release: | |
types: [prereleased, released] | |
jobs: | |
check-artifact: | |
name: PRODUCTION - Check if release artifact exists | |
runs-on: ubuntu-latest | |
outputs: | |
artifact_exists: ${{ steps.check.outputs.artifact_exists }} | |
steps: | |
- name: Check for artifact | |
id: check | |
run: | | |
if [ -f "${{ github.event.repository.name }}.zip" ]; then | |
echo "artifact_exists=true" >> $GITHUB_OUTPUT | |
else | |
echo "artifact_exists=false" >> $GITHUB_OUTPUT | |
fi | |
push-to-repository: | |
name: PRODUCTION - Generate release artifact | |
needs: check-artifact | |
if: needs.check-artifact.outputs.artifact_exists == 'false' | |
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: | |
name: PRODUCTION - Update release | |
needs: push-to-repository | |
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 ${{ github.event.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/[email protected] | |
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 |