-
Notifications
You must be signed in to change notification settings - Fork 2
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
4 changed files
with
48,154 additions
and
6,602 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,28 +1,40 @@ | ||
name: Deploy api to scaleway. | ||
name: Deploy to scaleway. | ||
|
||
|
||
# Run workflow on every push to master branch. | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
# Your workflows jobs. | ||
jobs: | ||
deploy_scw: | ||
runs-on: ubuntu-latest | ||
steps: | ||
# Check-out your repository. | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to scaleway | ||
run: docker login rg.fr-par.scw.cloud/my-services -u nologin --password-stdin <<< ${{ secrets.SCW_SECRET_KEY }} | ||
|
||
- name: Docker build | ||
run: docker build -t adaptaviz-fr:latest -f Dockerfile.prod . | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: 'arm64' | ||
|
||
- name: Docker tag | ||
run: docker tag adaptaviz-fr:latest rg.fr-par.scw.cloud/my-services/adaptaviz-fr:latest | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Docker push in namespace | ||
run: docker push rg.fr-par.scw.cloud/my-services/adaptaviz-fr:latest | ||
- name: Log in to the Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: rg.fr-par.scw.cloud/my-services | ||
username: nologin | ||
password: ${{ secrets.SCW_SECRET_KEY }} | ||
|
||
# Build the images | ||
- name: Build and push docker | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: true | ||
file: ./Dockerfile.prod | ||
tags: rg.fr-par.scw.cloud/my-services/adaptaviz-fr:latest | ||
platforms: linux/arm64 | ||
cache-from: type=gha,mode=max | ||
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 |
---|---|---|
@@ -1,28 +1,39 @@ | ||
FROM node:17.2-alpine | ||
|
||
RUN apk update | ||
RUN apk update && \ | ||
apk add g++ make py3-pip | ||
|
||
ARG user=app_user | ||
ARG home=/home/$user | ||
RUN mkdir -p $home | ||
RUN addgroup -S app_group && adduser -S app_user -G app_group | ||
WORKDIR $home | ||
ARG home=/home/app_user | ||
RUN mkdir -p /home/app_user && \ | ||
addgroup -S app_group && \ | ||
adduser -S app_user -G app_group | ||
|
||
USER $user | ||
WORKDIR /home/app_user | ||
|
||
COPY --chown=$user . $home | ||
USER app_user | ||
|
||
COPY --chown=app_user . /home/app_user | ||
|
||
RUN rm -rf /home/app/score | ||
|
||
ENV HOST 0.0.0.0 | ||
ENV NUXT_HOST 0.0.0.0 | ||
ENV NODE_OPTIONS --max-old-space-size=5120 --openssl-legacy-provider | ||
ENV NPM_CONFIG_PRODUCTION false | ||
ENV NUXT_BASE_API_URL https://www.adaptaviz.fr/api | ||
ENV NUXT_BASE_API_URL https://adaptaviz.fr/api | ||
|
||
RUN npm install && \ | ||
npm run build && \ | ||
npm prune --production && \ | ||
npm cache clean --force | ||
|
||
USER root | ||
|
||
RUN npm install | ||
RUN npm run build | ||
RUN apk del g++ make py3-pip && \ | ||
rm -rf /var/cache/apk/* && \ | ||
rm -rf package-lock.json | ||
|
||
USER $user | ||
USER app_user | ||
|
||
CMD ["npm", "start"] |
Oops, something went wrong.