Skip to content

Commit bb12cb1

Browse files
ci: use manual trigger on tag for dapp prod deployment (#213)
* ci: remove unused price and volume options in dapp-deploy workflow * ci: use manual trigger for dapp prod deployment
1 parent 3c9c583 commit bb12cb1

File tree

2 files changed

+23
-155
lines changed

2 files changed

+23
-155
lines changed

.github/workflows/dapp-deploy.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,13 @@ on:
88
required: true
99
type: choice
1010
options:
11+
# dev environments
1112
- bellecour-dev
1213
- arbitrum-sepolia-dev
13-
price:
14-
description: 'Sell order price (optionnel)'
15-
type: string
16-
required: false
17-
default: ''
18-
volume:
19-
description: 'Sell order volume (optionnel)'
20-
type: string
21-
required: false
22-
default: ''
14+
# prod environments (requires a tag starting with dapp-v)
15+
- bellecour-prod
16+
- arbitrum-sepolia-prod
17+
- arbitrum-mainnet-prod
2318

2419
jobs:
2520
extract-tag:
@@ -29,11 +24,24 @@ jobs:
2924
steps:
3025
- name: Checkout code
3126
uses: actions/checkout@v4
32-
33-
- name: Extract tag
27+
# if input environment ends with -prod
28+
# ref should be a tag beginning with dapp-v if not exit error
29+
# use unique clean-tag: <tag>-<timestamp>
30+
# else
31+
# use rolling clean-tag: dev
32+
- name: Check and extract tag
3433
id: tag
3534
run: |
36-
echo "clean_tag=dev" | tee -a $GITHUB_OUTPUT
35+
if [[ "${{ github.event.inputs.environment }}" == *-prod ]]; then
36+
if [[ "${GITHUB_REF}" != refs/tags/dapp-v* ]]; then
37+
echo "Error: The ref must be a tag starting with 'dapp-v' for production deployments."
38+
exit 1
39+
fi
40+
TAG=${GITHUB_REF#refs/tags/dapp-v}-$(date +%s)
41+
echo "clean_tag=${TAG}" | tee -a $GITHUB_OUTPUT
42+
else
43+
echo "clean_tag=dev" | tee -a $GITHUB_OUTPUT
44+
fi
3745
3846
docker-publish:
3947
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
@@ -128,8 +136,8 @@ jobs:
128136
- name: Publish free sell order
129137
env:
130138
WALLET_PRIVATE_KEY: ${{ secrets.WEB3MAIL_APP_OWNER_PRIVATEKEY }}
131-
PRICE: ${{ inputs.price || vars.SELL_ORDER_PRICE }}
132-
VOLUME: ${{ inputs.volume || vars.SELL_ORDER_VOLUME }}
139+
PRICE: ${{ vars.SELL_ORDER_PRICE }}
140+
VOLUME: ${{ vars.SELL_ORDER_VOLUME }}
133141
RPC_URL: ${{ secrets.RPC_URL }}
134142
run: |
135143
cd deployment-dapp

.github/workflows/dapp-release.yml

Lines changed: 0 additions & 140 deletions
This file was deleted.

0 commit comments

Comments
 (0)