Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: inject api-endpoint during buildtime #399

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ jobs:
sed -i "s#<PRODUCTION_API_ENDPOINT>#$API_ENDPOINT#g" ./ansible/docker-compose.yml
sed -i "s#<STAGING_API_ENDPOINT>#$STAGING_API_ENDPOINT#g" ./ansible/docker-compose.yml

- name: Pull & Rename Images
- name: Pull & Rebuild Images
env:
API_ENDPOINT: ${{ secrets.API_ENDPOINT }}
run: |
docker pull witnet/data-feed-app-ui:latest
docker pull witnet/data-feed-app-api:latest
docker tag witnet/data-feed-app-ui:latest witnet/data-feed-app-ui:${{github.ref_name}}
docker build --build-arg API_ENDPOINT=${{ secrets.API_ENDPOINT }} -t witnet/data-feed-app-ui:${{github.ref_name}} -f ./ansible/docker/ui.dockerfile ./packages/ui
docker tag witnet/data-feed-app-api:latest witnet/data-feed-app-api:${{github.ref_name}}

- name: Publish Containers
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ jobs:
sed -i "s#<STAGING_API_ENDPOINT>#$STAGING_API_ENDPOINT#g" ./ansible/docker-compose.yml

- name: Build Containers
env:
STAGING_API_ENDPOINT: ${{ secrets.STAGING_API_ENDPOINT }}
run: |
docker pull witnet/data-feed-app-ui:latest
docker pull witnet/data-feed-app-api:latest
docker build -t witnet/data-feed-app-ui:latest -f ./ansible/docker/ui.dockerfile ./packages/ui
docker build --build-arg API_ENDPOINT=${{ secrets.STAGING_API_ENDPOINT }} -t witnet/data-feed-app-ui:latest -f ./ansible/docker/ui.dockerfile ./packages/ui
docker build -t witnet/data-feed-app-api:latest -f ./ansible/docker/api.dockerfile ./packages/api

- name: Publish Containers
Expand Down
3 changes: 3 additions & 0 deletions ansible/docker/ui.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ EXPOSE 8080
ENV HOST=0.0.0.0
ENV PORT=8080

ARG API_ENDPOINT
ENV API_ENDPOINT=$API_ENDPOINT

RUN pnpm run build

CMD [ "node", ".output/server/index.mjs"]
Loading