File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Subgraph - deployer Docker Image
2+
3+ on :
4+ # For staging releases
5+ workflow_dispatch :
6+ # For latest releases
7+ release :
8+ types : [published]
9+
10+ jobs :
11+ get-version :
12+ if : ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref_name,'subgraph-v')) }}
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout code
16+ uses : actions/checkout@v4
17+ - name : Set up Node.js
18+ uses : actions/setup-node@v4
19+ with :
20+ node-version : ' 20'
21+ - name : compute version
22+ id : compute-publish-version
23+ run : |
24+ CURRENT_VERSION=$(npm pkg get version | tr -d '"')
25+ if [ "${{ github.event_name }}" = "release" ]; then
26+ echo "Release detected, setting version to ${CURRENT_VERSION}"
27+ echo "VERSION=${CURRENT_VERSION}" | tee -a $GITHUB_OUTPUT
28+ else
29+ echo "Manual dispatch detected, setting staging version"
30+ BRANCH=$(echo "${{ github.ref_name }}" | sed 's|/|-|g')
31+ COMMIT_SHA="${{ github.sha }}"
32+ echo "VERSION=${CURRENT_VERSION}-${BRANCH}-${COMMIT_SHA::7}" | tee -a $GITHUB_OUTPUT
33+ fi
34+ outputs :
35+ version : ${{ steps.compute-publish-version.outputs.VERSION }}
36+
37+ docker-publish :
38+ if : ${{ github.event_name == 'workflow_dispatch' || (github.event_name == 'release' && startsWith(github.ref_name,'subgraph-v')) }}
39+ uses : ./.github/workflows/reusable-subgraph-deployer-docker.yml
40+ needs : get-version
41+ with :
42+ tag : ${{ needs.get-version.outputs.version }}
43+ secrets :
44+ docker-username : ${{ secrets.DOCKERHUB_USERNAME }}
45+ docker-password : ${{ secrets.DOCKERHUB_PAT }}
You can’t perform that action at this time.
0 commit comments