diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml index 6b1ee0686..3d081a1ed 100644 --- a/.github/workflows/publish-dist.yml +++ b/.github/workflows/publish-dist.yml @@ -148,6 +148,7 @@ jobs: ENV_NAME=${{ env.ENV_NAME }} tags: | vegaprotocol/${{ matrix.app }}:${{ github.ref_name }} + vegaprotocol/${{ matrix.app }}:mainnet # bucket creation in github.com/vegaprotocol/terraform//frontend - name: Publish dist to s3 @@ -174,3 +175,18 @@ jobs: if: ${{ matrix.app == 'trading' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} with: files: ${{ matrix.app }}-ipfs-hash + + - name: Trigger fleek deployment + if: ${{ matrix.app == 'trading' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} + run: | + # display info about app + curl -H "Authorization: $FLEEK_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"query": "query{getSiteById(siteId:\"f8f2e051-f18e-49e6-b876-0a39369dc0d8\"){id latestDeploy{id status}}}"}' \ + https://api.fleek.co/graphql + + # trigger new deployment as base image is always set to vegaprotocol/trading:mainnet + curl -H "Authorization: $FLEEK_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{"query": "mutation{triggerDeploy(siteId:\"f8f2e051-f18e-49e6-b876-0a39369dc0d8\"){id status}}"}' \ + https://api.fleek.co/graphql diff --git a/Makefile b/Makefile index c5bda8cb0..e28979c2b 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ recalculate-ipfs: echo "ipfs hash inside the image" docker run --rm ${TAG} cat /ipfs-hash echo "recalculating ipfs hash" - docker run --rm ${TAG} ipfs add -rw /usr/share/nginx/html + docker run --rm ${TAG} ipfs add -r /usr/share/nginx/html .PHONY: eject-ipfs-hash unpack: diff --git a/docker/ipfs.Dockerfile b/docker/ipfs.Dockerfile deleted file mode 100644 index c8c62332b..000000000 --- a/docker/ipfs.Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# Build container -ARG NODE_VERSION -FROM --platform=amd64 node:${NODE_VERSION}-alpine3.16 as build -WORKDIR /app -# Argument to allow building of different apps -ARG APP -ARG ENV_NAME="" -RUN apk add --update --no-cache \ - python3 \ - make \ - gcc \ - g++ -COPY . ./ -RUN yarn --network-timeout 100000 --pure-lockfile -# work around for different build process in trading -RUN sh docker/docker-build.sh - -# Server environment -# if this fails you need to docker pull nginx:1.23-alpine and pin new SHA -# this is to ensure that we run always same version of alpine to make sure ipfs is indempotent -FROM --platform=amd64 nginx:1.23-alpine@sha256:6318314189b40e73145a48060bff4783a116c34cc7241532d0d94198fb2c9629 -# configuration of system -EXPOSE 80 -# Copy dist -WORKDIR /usr/share/nginx/html -COPY docker/nginx.conf /etc/nginx/conf.d/default.conf -RUN rm -rf /usr/share/nginx/html/* -COPY --from=build /app/dist/apps/${APP}/* /usr/share/nginx/html -RUN apk add --no-cache go-ipfs; ipfs init && echo "$(ipfs add -rQ .)" > /ipfs-hash; apk del go-ipfs diff --git a/docker/node-inside-docker.Dockerfile b/docker/node-inside-docker.Dockerfile index e15f15a58..9635d4cbd 100644 --- a/docker/node-inside-docker.Dockerfile +++ b/docker/node-inside-docker.Dockerfile @@ -27,5 +27,5 @@ RUN rm -rf /usr/share/nginx/html/* COPY --from=build /app/dist/apps/${APP}/* /usr/share/nginx/html RUN apk add --no-cache go-ipfs==0.16.0-r6 \ && ipfs init \ - && echo "$(ipfs add -rwQ /usr/share/nginx/html)" > /ipfs-hash \ + && echo "$(ipfs add -rQ /usr/share/nginx/html)" > /ipfs-hash \ && echo "ipfs hash of this build: $(cat /ipfs-hash)" diff --git a/docker/node-outside-docker.Dockerfile b/docker/node-outside-docker.Dockerfile index 52d0d8896..e185fa8bc 100644 --- a/docker/node-outside-docker.Dockerfile +++ b/docker/node-outside-docker.Dockerfile @@ -5,6 +5,6 @@ RUN rm -rf /usr/share/nginx/html/* COPY ./dist-result/ /usr/share/nginx/html/ RUN apk add --no-cache go-ipfs==0.16.0-r6 \ && ipfs init \ - && echo "$(ipfs add -rwQ /usr/share/nginx/html)" > /ipfs-hash \ + && echo "$(ipfs add -rQ /usr/share/nginx/html)" > /ipfs-hash \ && echo "ipfs hash of this build: $(cat /ipfs-hash)"