Skip to content

Commit

Permalink
Added deployment for webapp.
Browse files Browse the repository at this point in the history
  • Loading branch information
pantierra committed Nov 14, 2024
1 parent 416317d commit 2770230
Show file tree
Hide file tree
Showing 32 changed files with 59 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy-webapp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: deploy webapp
concurrency: deploy

on:
workflow_dispatch:
push:
branches:
- main
- develop
paths:
- frontend/**
- .github/workflows/deploy-webapp.yaml

jobs:
build:
name: Deploy frontend
runs-on: "ubuntu-latest"
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker
uses: azure/docker-login@v1
with:
login-server: c63eqfuv.c1.gra9.container-registry.ovh.net
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: c63eqfuv.c1.gra9.container-registry.ovh.net/webapp
tags: |
type=ref,event=branch
type=sha,format=short
latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ./webapp
file: ./webapp/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM node:alpine
WORKDIR /app
COPY package.json /app
RUN yarn install
COPY . /app
CMD ["yarn", "run", "start"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.

0 comments on commit 2770230

Please sign in to comment.