File tree Expand file tree Collapse file tree 2 files changed +87
-0
lines changed
Expand file tree Collapse file tree 2 files changed +87
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy webapp
2+ concurrency : deploy
3+
4+ on :
5+ workflow_dispatch :
6+ push :
7+ branches :
8+ - main
9+ - feature/Dockerfile
10+
11+ jobs :
12+ build :
13+ name : Build and Push Container
14+ runs-on : ubuntu-24.04
15+
16+ steps :
17+ - name : Set up SSH
18+ uses : webfactory/ssh-agent@v0.8.0
19+ with :
20+ ssh-private-key : ${{ secrets.SSH_PRIVATE_KEY }}
21+
22+ - name : Checkout repository (with private submodules)
23+ uses : actions/checkout@v4
24+ with :
25+ submodules : recursive
26+
27+ - name : Set up Docker Buildx
28+ uses : docker/setup-buildx-action@v3
29+
30+ - name : Login to Docker registry
31+ uses : azure/docker-login@v1
32+ with :
33+ login-server : 66gc0z34.c1.gra9.container-registry.ovh.net
34+ username : ${{ secrets.DOCKER_USERNAME }}
35+ password : ${{ secrets.DOCKER_PASSWORD }}
36+
37+ - name : Extract Docker metadata
38+ id : meta
39+ uses : docker/metadata-action@v5
40+ with :
41+ images : 66gc0z34.c1.gra9.container-registry.ovh.net/gfts/webapp
42+ tags : |
43+ type=ref,event=branch
44+ type=sha,format=short
45+ latest
46+
47+ - name : Build and push Docker image
48+ uses : docker/build-push-action@v5
49+ with :
50+ context : .
51+ file : ./Dockerfile
52+ push : true
53+ tags : ${{ steps.meta.outputs.tags }}
54+ labels : ${{ steps.meta.outputs.labels }}
55+ build-args : |
56+ MAPBOX_TOKEN=${{ secrets.MAPBOX_TOKEN }}
57+ WEBAPP_URL=${{ secrets.WEBAPP_URL }}
Original file line number Diff line number Diff line change 1+ FROM node:24-alpine AS builder
2+
3+ ARG WEBAPP_URL="https://gfts.developmentseed.org"
4+ ARG MAPBOX_TOKEN=""
5+ ARG GITHUB_TOKEN=""
6+
7+ ENV NODE_ENV=production
8+ ENV PUBLIC_URL=${WEBAPP_URL}
9+ ENV DATA_API=${WEBAPP_URL}
10+ ENV MAPBOX_TOKEN=${MAPBOX_TOKEN}
11+ ENV GITHUB_TOKEN=${GITHUB_TOKEN}
12+
13+ WORKDIR /app
14+
15+ # Copy the pre-cloned source code (with submodules)
16+ COPY . .
17+
18+ # Enable Corepack (to use Yarn 3+)
19+ RUN corepack enable && \
20+ yarn install --frozen-lockfile && \
21+ yarn build && \
22+ cp ./dist/index.html ./dist/404.html
23+
24+ FROM nginx:alpine-slim
25+
26+ COPY --from=builder /app/dist /usr/share/nginx/html
27+
28+ EXPOSE 80
29+
30+ CMD ["nginx" , "-g" , "daemon off;" ]
You can’t perform that action at this time.
0 commit comments