From 5f435227caf78c136abffe484ad509ae45fc6e13 Mon Sep 17 00:00:00 2001 From: Daniel Blanco Parla Date: Mon, 5 Aug 2024 16:29:08 +0200 Subject: [PATCH] chore: Add GitHub Actions workflow for deploying static content to Pages and update Node version --- .github/workflows/pages.yml | 57 ++++++++++++++++++++++++++ app/src/Pages/Main/Components/Box3.tsx | 4 +- 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..cc9127f --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,57 @@ +name: Deploy static content to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: ["main"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages +permissions: + packages: read + contents: read + pages: write + id-token: write + +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./app/ + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: "yarn" + registry-url: "https://npm.pkg.github.com" + - name: Install dependencies + run: yarn + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Build + run: yarn build + - name: Setup Pages + uses: actions/configure-pages@v3 + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + # Upload dist repository + path: "./dist" + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/app/src/Pages/Main/Components/Box3.tsx b/app/src/Pages/Main/Components/Box3.tsx index 93161e9..573acb9 100644 --- a/app/src/Pages/Main/Components/Box3.tsx +++ b/app/src/Pages/Main/Components/Box3.tsx @@ -31,8 +31,8 @@ import { TokenABI } from "../../../lib/ABI/Token"; export const Box3 = () => { const { address } = useAccount(); const [amount0, setAmount0] = useState("1000"); - const [from, setFrom] = useState
(tokenAddressMap["stbleUSD"]); - const [to, setTo] = useState
(tokenAddressMap["Bitcoin"]); + const [from] = useState
(tokenAddressMap["stbleUSD"]); + const [to] = useState
(tokenAddressMap["Bitcoin"]); const { swap, approve } = useSwap(); const toast = useToast(); const { connect, connectors } = useConnect();