Deploy Image Guessing Game #67
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: Deploy Image Guessing Game | |
on: | |
workflow_dispatch: | |
inputs: | |
address: | |
description: "Contract Address" | |
required: true | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Install dependencies | |
run: npm install | |
working-directory: ./spot-the-ball | |
- name: create env file | |
working-directory: ./spot-the-ball | |
run: | | |
touch .env | |
echo VITE_APP_MORALIS_API_KEY='${{ secrets.VITE_APP_MORALIS_API_KEY }}' >> .env | |
echo VITE_APP_NFT_UP_KEY='${{ secrets.VITE_APP_NFT_UP_KEY }}' >> .env | |
- name: Write Address to JSON | |
run: | | |
echo '{"address": "${{ github.event.inputs.address }}"}' > ./spot-the-ball/src/assets/contract/address.json | |
- name: Build application | |
run: npm run build | |
working-directory: ./spot-the-ball | |
env: | |
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }} | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./spot-the-ball/dist | |
destination_dir: ./spot-the-ball |