diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..054d4a12c --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,52 @@ +name: deploy +on: + schedule: + - cron: '*/10 * * * *' # every 10 minutes + + workflow_dispatch: + +jobs: + ipfs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + + - uses: actions/cache@v2 + with: + path: ./cache + key: ${{ runner.os }}-cache-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-cache- + + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: Install python dependencies + run: pip install -r requirements.txt + + - name: Add custom brownie network + env: + WEB3_PROVIDER: ${{ secrets.WEB3_PROVIDER }} + run: brownie networks add Ethereum mainnet-custom host=$WEB3_PROVIDER chainid=1 explorer=https://api.etherscan.io/api + + - name: Deploy + env: + AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }} + AWS_ACCESS_SECRET: ${{ secrets.AWS_ACCESS_SECRET }} + AWS_ZONE_ID: ${{ secrets.AWS_ZONE_ID }} + AWS_ZONE_RECORD: ${{ secrets.AWS_ZONE_RECORD }} + ETHERSCAN_TOKEN: ${{ secrets.ETHERSCAN_TOKEN }} + IPFS_NODE_ADDRESS: ${{ secrets.IPFS_NODE_ADDRESS }} + IPFS_NODE_KEY: ${{ secrets.IPFS_NODE_KEY }} + IPFS_NODE_SECRET: ${{ secrets.IPFS_NODE_SECRET }} + WEB3_PROVIDER: ${{ secrets.WEB3_PROVIDER }} + run: brownie run ipfs --network mainnet-custom