Skip to content

Commit

Permalink
ci: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fmorency committed Nov 19, 2024
1 parent f551636 commit f2c4253
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 63 deletions.
42 changes: 15 additions & 27 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ jobs:
environment: 'Production - Testnet'

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -24,32 +21,23 @@ jobs:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Create .env file
run: |
touch .env
echo "NEXT_PUBLIC_CHAIN=${{ vars.NEXT_PUBLIC_CHAIN }}" >> .env
echo "NEXT_PUBLIC_CHAIN_ID=${{ vars.NEXT_PUBLIC_CHAIN_ID }}" >> .env
echo "NEXT_PUBLIC_TESTNET_CHAIN_ID=${{ vars.NEXT_PUBLIC_TESTNET_CHAIN_ID }}" >> .env
echo "NEXT_PUBLIC_MAINNET_RPC_URL=${{ vars.NEXT_PUBLIC_MAINNET_RPC_URL }}" >> .env
echo "NEXT_PUBLIC_TESTNET_RPC_URL=${{ vars.NEXT_PUBLIC_TESTNET_RPC_URL }}" >> .env
echo "NEXT_PUBLIC_MAINNET_API_URL=${{ vars.NEXT_PUBLIC_MAINNET_API_URL }}" >> .env
echo "NEXT_PUBLIC_TESTNET_API_URL=${{ vars.NEXT_PUBLIC_TESTNET_API_URL }}" >> .env
echo "NEXT_PUBLIC_ABLY_API_KEY=${{ secrets.NEXT_PUBLIC_ABLY_API_KEY }}" >> .env
echo "NEXT_PUBLIC_WALLETCONNECT_KEY=${{ secrets.NEXT_PUBLIC_WALLETCONNECT_KEY }}" >> .env
echo "NEXT_PUBLIC_WEB3_CLIENT_ID=${{ secrets.NEXT_PUBLIC_WEB3_CLIENT_ID }}" >> .env
cat .env
- name: Build and push Docker image
uses: docker/build-push-action@v6
env:
NEXT_PUBLIC_CHAIN: ${{ vars.NEXT_PUBLIC_CHAIN }}
NEXT_PUBLIC_CHAIN_ID: ${{ vars.NEXT_PUBLIC_CHAIN_ID }}
NEXT_PUBLIC_TESTNET_CHAIN_ID: ${{ vars.NEXT_PUBLIC_TESTNET_CHAIN_ID }}
NEXT_PUBLIC_MAINNET_RPC_URL: ${{ vars.NEXT_PUBLIC_MAINNET_RPC_URL }}
NEXT_PUBLIC_TESTNET_RPC_URL: ${{ vars.NEXT_PUBLIC_TESTNET_RPC_URL }}
NEXT_PUBLIC_MAINNET_API_URL: ${{ vars.NEXT_PUBLIC_MAINNET_API_URL }}
NEXT_PUBLIC_TESTNET_API_URL: ${{ vars.NEXT_PUBLIC_TESTNET_API_URL }}
ABLY_API_KEY: ${{ secrets.NEXT_PUBLIC_ABLY_API_KEY }}
WALLETCONNECT_KEY: ${{ secrets.NEXT_PUBLIC_WALLETCONNECT_KEY }}
WEB3_CLIENT_ID: ${{ secrets.NEXT_PUBLIC_WEB3_CLIENT_ID }}
with:
context: .
push: true
tags: lifted/manifest-app:testnet
build-args: |
"NEXT_PUBLIC_CHAIN=${{ vars.NEXT_PUBLIC_CHAIN }}"
"NEXT_PUBLIC_CHAIN_ID=${{ vars.NEXT_PUBLIC_CHAIN_ID }}"
"NEXT_PUBLIC_TESTNET_CHAIN_ID=${{ vars.NEXT_PUBLIC_TESTNET_CHAIN_ID }}"
"NEXT_PUBLIC_MAINNET_RPC_URL=${{ vars.NEXT_PUBLIC_MAINNET_RPC_URL }}"
"NEXT_PUBLIC_TESTNET_RPC_URL=${{ vars.NEXT_PUBLIC_TESTNET_RPC_URL }}"
"NEXT_PUBLIC_MAINNET_API_URL=${{ vars.NEXT_PUBLIC_MAINNET_API_URL }}"
"NEXT_PUBLIC_TESTNET_API_URL=${{ vars.NEXT_PUBLIC_TESTNET_API_URL }}"
secrets: |
"ably_api_key=$ABLY_API_KEY"
"walletconnect_key=$WALLETCONNECT_KEY"
"web3auth_key=$WEB3_CLIENT_ID"
36 changes: 0 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,6 @@
# syntax=docker.io/docker/dockerfile:1

FROM oven/bun:slim AS base
RUN --mount=type=secret,id=ably_api_key,env=NEXT_PUBLIC_ABLY_API_KEY \
--mount=type=secret,id=walletconnect_key,env=NEXT_PUBLIC_WALLETCONNECT_KEY \
--mount=type=secret,id=web3auth_key,env=NEXT_PUBLIC_WEB3_CLIENT_ID

ARG NEXT_PUBLIC_CHAIN
ARG NEXT_PUBLIC_CHAIN_ID
ARG NEXT_PUBLIC_TESTNET_CHAIN_ID
ARG NEXT_PUBLIC_MAINNET_RPC_URL
ARG NEXT_PUBLIC_TESTNET_RPC_URL
ARG NEXT_PUBLIC_MAINNET_API_URL
ARG NEXT_PUBLIC_TESTNET_API_URL

ENV NEXT_PUBLIC_CHAIN=${NEXT_PUBLIC_CHAIN}
ENV NEXT_PUBLIC_CHAIN_ID=${NEXT_PUBLIC_CHAIN_ID}
ENV NEXT_PUBLIC_TESTNET_CHAIN_ID=${NEXT_PUBLIC_TESTNET_CHAIN_ID}
ENV NEXT_PUBLIC_MAINNET_RPC_URL=${NEXT_PUBLIC_MAINNET_RPC_URL}
ENV NEXT_PUBLIC_TESTNET_RPC_URL=${NEXT_PUBLIC_TESTNET_RPC_URL}
ENV NEXT_PUBLIC_MAINNET_API_URL=${NEXT_PUBLIC_MAINNET_API_URL}
ENV NEXT_PUBLIC_TESTNET_API_URL=${NEXT_PUBLIC_TESTNET_API_URL}

RUN echo "Base: $NEXT_PUBLIC_CHAIN"
RUN echo "Base: $NEXT_PUBLIC_CHAIN_ID"
RUN echo "Base: $NEXT_PUBLIC_TESTNET_CHAIN_ID"
RUN echo "Base: $NEXT_PUBLIC_MAINNET_RPC_URL"
RUN echo "Base: $NEXT_PUBLIC_TESTNET_RPC_URL"
RUN echo "Base: $NEXT_PUBLIC_MAINNET_API_URL"
RUN echo "Base: $NEXT_PUBLIC_TESTNET_API_URL"


# Install dependencies only when needed
FROM base AS deps
Expand Down Expand Up @@ -56,14 +28,6 @@ COPY . .
# Uncomment the following line in case you want to disable telemetry during the build.
ENV NEXT_TELEMETRY_DISABLED=1

RUN echo "Builder: $NEXT_PUBLIC_CHAIN"
RUN echo "Builder: $NEXT_PUBLIC_CHAIN_ID"
RUN echo "Builder: $NEXT_PUBLIC_TESTNET_CHAIN_ID"
RUN echo "Builder: $NEXT_PUBLIC_MAINNET_RPC_URL"
RUN echo "Builder: $NEXT_PUBLIC_TESTNET_RPC_URL"
RUN echo "Builder: $NEXT_PUBLIC_MAINNET_API_URL"
RUN echo "Builder: $NEXT_PUBLIC_TESTNET_API_URL"

RUN \
if [ -f yarn.lock ]; then yarn run build; \
elif [ -f package-lock.json ]; then npm run build; \
Expand Down

0 comments on commit f2c4253

Please sign in to comment.