Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
[ci] - workflow de déploiement
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinM27 committed Dec 12, 2023
1 parent d7ea001 commit 08701a2
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Deploy The Archiver

on:
push:
branches: ["main"]

jobs:
deploy:
runs-on: ubuntu-latest
env:
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
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 private registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: "${{ secrets.REGISTRY_URL }}/the-archiver:latest"
- name: Executing remote ssh commands using password
uses: appleboy/ssh-action@v1.0.0
with:
host: ${{ secrets.SERVER_URL }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWD }}
port: ${{ secrets.SERVER_PORT }}
script: |
docker login -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }} ${{ secrets.REGISTRY_URL }}
docker pull ${{ secrets.REGISTRY_URL }}/the-archiver:latest
docker rm -f the-archiver || true && docker run -d --network infra --name the-archiver ${{ secrets.REGISTRY_URL }}/the-archiver:latest
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
FROM node:18-alpine

# Install nodemon
RUN npm install -g nodemon

# Create app directory
WORKDIR /usr/src/app

Expand All @@ -15,8 +12,15 @@ RUN npm install
# Bundle app source
COPY . .

# Set environment variable during build
ARG BUCKET_NAME
ENV BUCKET_NAME=${BUCKET_NAME}

# Build the app
RUN npm run build

# Expose the app's port
EXPOSE 3000

# Run the app in development mode with hot reloading
CMD ["nodemon", "--watch", ".", "--exec", "npm", "run", "dev"]
# Run the app
CMD [ "npm", "run", "start" ]
3 changes: 3 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
eslint: {
ignoreDuringBuilds: true,
},
};

module.exports = nextConfig;

1 comment on commit 08701a2

@vercel
Copy link

@vercel vercel bot commented on 08701a2 Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.