/ .github / workflows / update-prod-staging.yml
update-prod-staging.yml
 1  name: Reusable workflow for updating prod and staging
 2  
 3  on:
 4    workflow_call:
 5      inputs:
 6        PINATA_HASH:
 7          type: string
 8          description: IPFS hash to pin and use in release description
 9          required: true
10  
11  jobs:
12    deploy:
13      runs-on: ubuntu-latest
14      strategy:
15        matrix:
16          environment:
17            [{ name: 'Production', domain: 'app.aave.com', artifact: 'out', build_path: 'out' }]
18      environment:
19        name: ${{ matrix.environment.name }}
20        url: https://${{ matrix.environment.domain }}
21      steps:
22        - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
23  
24        - name: download build
25          uses: actions/download-artifact@v4
26          with:
27            name: ${{ matrix.environment.artifact }}
28            path: ${{ matrix.environment.build_path }}
29  
30        - name: Pin to primary IPFS server
31          id: ipfs-primary
32          uses: ./.github/actions/ipfs-pin
33          with:
34            DOMAIN: ${{ matrix.environment.domain }}
35            IPFS_SERVER_PORT: '${{ secrets.IPFS_PRIMARY_SERVER_PORT }}'
36            IPFS_SERVER: '${{ secrets.IPFS_PRIMARY_SERVER }}'
37            IPFS_SERVER_KEY: '${{ secrets.IPFS_PRIMARY_SERVER_KEY }}'
38            BUILD_PATH: ${{ matrix.environment.build_path }}
39            PINATA_HASH: ${{ inputs.PINATA_HASH }}
40  
41        - name: prepare release
42          run: |
43            cp .github/release-template.md ./release-notes.md
44            sed -i 's|<ipfs-hash>|${{ inputs.PINATA_HASH }}|g' ./release-notes.md
45            echo "TAG=release-$(date '+%Y-%m-%d_%H-%M')" >> ${GITHUB_ENV}
46  
47        - name: Create GH release
48          uses: ncipollo/release-action@4c75f0f2e4ae5f3c807cf0904605408e319dcaac # v1.10.0
49          with:
50            name: Production release
51            artifacts: app.tar.gz
52            bodyFile: release-notes.md
53            commit: '${{ github.sha }}'
54            tag: '${{ env.TAG }}'