Skip to content

Commit 9ee2bc4

Browse files
Copilotlippytm
andcommitted
Simplify deploy.yml by removing unnecessary matrix strategy
Remove complex matrix strategy from single-environment deploy job and use inputs.environment directly for cleaner, more maintainable code Co-authored-by: lippytm <65956507+lippytm@users.noreply.github.com>
1 parent ad99fd9 commit 9ee2bc4

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ jobs:
2525
runs-on: ubuntu-latest
2626
environment:
2727
name: ${{ inputs.environment || 'dev' }}
28-
strategy:
29-
matrix:
30-
environment: ${{ inputs.environment && fromJSON(format('["{0}"]', inputs.environment)) || fromJSON('["dev"]') }}
3128
permissions:
3229
contents: read
3330
id-token: write
@@ -76,7 +73,7 @@ jobs:
7673

7774
- name: Load environment variables
7875
run: |
79-
echo "Environment: ${{ matrix.environment }}"
76+
echo "Environment: ${{ inputs.environment || 'dev' }}"
8077
# Required secrets/variables for deployment:
8178
# WEB3_RPC_URL: Blockchain RPC endpoint
8279
# OPENAI_API_KEY: OpenAI API key for AI features
@@ -116,7 +113,7 @@ jobs:
116113
# Deployment steps (customize based on your deployment target)
117114
- name: Deploy Backend
118115
run: |
119-
echo "Deploying backend to ${{ matrix.environment }}"
116+
echo "Deploying backend to ${{ inputs.environment || 'dev' }}"
120117
# Add your backend deployment commands here
121118
# Examples:
122119
# - Deploy to AWS Lambda, ECS, or EC2
@@ -127,7 +124,7 @@ jobs:
127124
128125
- name: Deploy Frontend
129126
run: |
130-
echo "Deploying frontend to ${{ matrix.environment }}"
127+
echo "Deploying frontend to ${{ inputs.environment || 'dev' }}"
131128
# Add your frontend deployment commands here
132129
# Examples:
133130
# - Deploy to AWS S3 + CloudFront
@@ -138,7 +135,7 @@ jobs:
138135
- name: Deploy Contracts (if needed)
139136
working-directory: ./contracts
140137
run: |
141-
echo "Deploying smart contracts to ${{ matrix.environment }}"
138+
echo "Deploying smart contracts to ${{ inputs.environment || 'dev' }}"
142139
# Add your contract deployment commands here
143140
# Only run for specific environments (e.g., stage, prod)
144141
# Requires PRIVATE_KEY secret for contract deployment
@@ -147,11 +144,11 @@ jobs:
147144
- name: Notify deployment status
148145
if: always()
149146
run: |
150-
echo "Deployment to ${{ matrix.environment }} completed with status: ${{ job.status }}"
147+
echo "Deployment to ${{ inputs.environment || 'dev' }} completed with status: ${{ job.status }}"
151148
# Add notification logic here (Slack, Discord, email, etc.)
152149
# Example using Slack:
153150
# curl -X POST -H 'Content-type: application/json' \
154-
# --data '{"text":"Deployment to ${{ matrix.environment }}: ${{ job.status }}"}' \
151+
# --data '{"text":"Deployment to ${{ inputs.environment || 'dev' }}: ${{ job.status }}"}' \
155152
# ${{ secrets.SLACK_WEBHOOK_URL }}
156153
157154
deploy-matrix:

0 commit comments

Comments
 (0)