-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
99 additions
and
60 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,71 @@ | ||
# web-core image is meant to be used only by our safe-infrastructure repository | ||
# This Docker image is meant to be used only by our safe-infrastructure repository | ||
|
||
name: Web Deploy to Dockerhub | ||
name: Web Deploy to Dockerhub | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- docker | ||
paths: | ||
- apps/web/** | ||
|
||
push: | ||
branches: | ||
- main | ||
- dev | ||
paths: | ||
- apps/web/** | ||
|
||
release: | ||
types: [ released ] | ||
types: [released] | ||
|
||
jobs: | ||
dockerhub-push: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || (github.event_name == 'release' && github.event.action == 'released') | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: arm64 | ||
- uses: docker/setup-buildx-action@v3 | ||
- name: Dockerhub login | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Deploy Main | ||
if: github.ref == 'refs/heads/main' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./apps/web | ||
push: true | ||
tags: safeglobal/safe-wallet-web:staging | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: Deploy Develop | ||
if: github.ref == 'refs/heads/dev' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./apps/web | ||
push: true | ||
tags: safeglobal/safe-wallet-web:dev | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: Deploy Tag | ||
if: (github.event_name == 'release' && github.event.action == 'released') | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: ./apps/web | ||
push: true | ||
tags: | | ||
safeglobal/safe-wallet-web:${{ github.event.release.tag_name }} | ||
safeglobal/safe-wallet-web:latest | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- uses: actions/checkout@v4 | ||
- uses: docker/setup-qemu-action@v3 | ||
with: | ||
platforms: arm64 | ||
- uses: docker/setup-buildx-action@v3 | ||
- name: Dockerhub login | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Deploy Main | ||
if: github.ref == 'refs/heads/main' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: safeglobal/safe-wallet-web:staging | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: Deploy Develop | ||
if: github.ref == 'refs/heads/dev' | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: safeglobal/safe-wallet-web:dev | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
- name: Deploy Tag | ||
if: (github.event_name == 'release' && github.event.action == 'released') | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
tags: | | ||
safeglobal/safe-wallet-web:${{ github.event.release.tag_name }} | ||
safeglobal/safe-wallet-web:latest | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM node:18-alpine | ||
RUN apk add --no-cache libc6-compat git python3 py3-pip make g++ libusb-dev eudev-dev linux-headers | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy root | ||
COPY . . | ||
|
||
# Set working directory to the web app | ||
WORKDIR apps/web | ||
|
||
# Enable corepack and configure yarn | ||
RUN corepack enable | ||
RUN yarn config set httpTimeout 300000 | ||
|
||
# Run any custom post-install scripts | ||
RUN yarn install --immutable | ||
RUN yarn after-install | ||
|
||
# Set environment variables | ||
ENV NODE_ENV production | ||
Check warning on line 22 in Dockerfile GitHub Actions / dockerhub-pushLegacy key/value format with whitespace separator should not be used
|
||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
Check warning on line 23 in Dockerfile GitHub Actions / dockerhub-pushLegacy key/value format with whitespace separator should not be used
|
||
ENV PORT 3000 | ||
Check warning on line 24 in Dockerfile GitHub Actions / dockerhub-pushLegacy key/value format with whitespace separator should not be used
|
||
|
||
# Expose the port | ||
EXPOSE 3000 | ||
|
||
# Command to start the application | ||
CMD ["yarn", "static-serve"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,30 @@ | ||
FROM node:18-alpine | ||
RUN apk add --no-cache libc6-compat git python3 py3-pip make g++ libusb-dev eudev-dev linux-headers | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Copy root | ||
COPY . . | ||
|
||
# Set working directory to the web app | ||
WORKDIR apps/web | ||
|
||
# Enable corepack and configure yarn | ||
RUN corepack enable | ||
# Fix arm64 timeouts | ||
RUN yarn config set httpTimeout 300000 | ||
|
||
# install deps | ||
# Run any custom post-install scripts | ||
RUN yarn install --immutable | ||
RUN yarn after-install | ||
|
||
# Set environment variables | ||
ENV NODE_ENV production | ||
|
||
# Next.js collects completely anonymous telemetry data about general usage. | ||
# Learn more here: https://nextjs.org/telemetry | ||
# Uncomment the following line in case you want to disable telemetry during the build. | ||
ENV NEXT_TELEMETRY_DISABLED 1 | ||
ENV PORT 3000 | ||
|
||
# Expose the port | ||
EXPOSE 3000 | ||
|
||
ENV PORT 3000 | ||
|
||
CMD ["yarn", "static-serve"] | ||
# Command to start the application | ||
CMD ["yarn", "static-serve"] |