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