Helloworld Daily Deploy #534
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Helloworld Daily Deploy | |
on: | |
push: | |
paths: | |
- hello-world/** | |
workflow_dispatch: | |
schedule: | |
- cron: "0 7 * * *" | |
jobs: | |
deploy-hello-world: | |
defaults: | |
run: | |
working-directory: ./hello-world/smart-contract/ | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
cache: "npm" | |
cache-dependency-path: ./hello-world/smart-contract/package-lock.json | |
- name: Install dependencies | |
run: npm install | |
- name: Deploy | |
run: | | |
if npm run deploy | grep -q "Contract deployed"; then | |
echo "Contract successfully deployed!" | |
else | |
echo "Failed to deploy contract ..." | |
exit 1 | |
fi | |
env: | |
JSON_RPC_URL_PUBLIC: ${{ secrets.JSON_RPC_URL_PUBLIC }} | |
WALLET_PRIVATE_KEY: ${{ secrets.WALLET_PRIVATE_KEY }} |