From 384c177fc2953b6a500fa85dc1c921f7db16f3cb Mon Sep 17 00:00:00 2001 From: ledouxm Date: Wed, 10 Apr 2024 16:10:26 +0200 Subject: [PATCH] feat: add github actions --- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++++++ Dockerfile | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..e8c6d994 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,35 @@ +name: ci + +on: + push: + branches: + - "main" + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + target: backend + tags: betagouv/compte-rendu-vif-backend:latest + + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + target: frontend + tags: betagouv/compte-rendu-vif-frontend:latest diff --git a/Dockerfile b/Dockerfile index 76ea1c62..c838d2d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ################################ # BASE IMAGE FOR EVERY SERVICE # ################################ -FROM --platform=linux/amd64 node:18 AS with-pnpm +FROM --platform=linux/amd64 node:20-alpine AS with-pnpm RUN npm i -g pnpm ################################