Skip to content

Commit

Permalink
Merge master (#412)
Browse files Browse the repository at this point in the history
* Update dockerfile for new SIA infrastructure

* Update ci.yml

* fix: update cash prize value in home page

---------

Co-authored-by: Guillaume ETHEVE <[email protected]>
  • Loading branch information
Suboyyy and Blendman974 authored Nov 24, 2024
1 parent ef80585 commit 0936c17
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 28 deletions.
80 changes: 53 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
lint:
runs-on: ubuntu-latest
runs-on: self-hosted
strategy:
matrix:
node-version: [18]
Expand All @@ -33,7 +33,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

build:
runs-on: ubuntu-latest
runs-on: self-hosted
strategy:
matrix:
node-version: [18]
Expand All @@ -58,34 +58,60 @@ jobs:
url: ${{ secrets.SLACK_WEBHOOK_URL }}
token: ${{ secrets.GITHUB_TOKEN }}

deploy:
if: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/teaser' || github.ref == 'refs/heads/dev') }}
runs-on: ubuntu-latest
deploy-dev:
if: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/dev') }}
runs-on: self-hosted
needs:
- lint
- build
env:
RESOURCE_NAME: ${{ github.ref == 'refs/heads/master' && 'prod-front' || github.ref == 'refs/heads/teaser' && 'prod-teaser' || 'dev-front' }}
steps:
- uses: actions/checkout@v3
- name: Install oc
uses: redhat-actions/oc-installer@v1
- uses: actions/checkout@v4
- name: Install docker
uses: docker/setup-buildx-action@v3
- name: Login to registry
uses: docker/login-action@v3
with:
oc_version: '4.6'
- name: Login to OKD
run: oc login --token=${{ secrets.OKD_TOKEN }} --server=${{ secrets.OKD_SERVER }}

- name: Change the project
run: oc project ${{ secrets.OKD_PROJECT }}

- name: Start the build
run: oc start-build ${{ env.RESOURCE_NAME }} --follow

- uses: lazy-actions/slatify@master
if: ${{ always() }}
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
build-args: |
NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL_DEV }}
NEXT_PUBLIC_UPLOADS_URL=${{ secrets.NEXT_PUBLIC_UPLOADS_URL_DEV }}
NEXT_PUBLIC_GOOGLE_VERIFICATION=${{ secrets.NEXT_PUBLIC_GOOGLE_VERIFICATION_DEV }}
NEXT_PUBLIC_URL=${{ secrets.NEXT_PUBLIC_URL_DEV }}
NEXT_PUBLIC_STRIPE_PUBLIC_KEY=${{ secrets.NEXT_PUBLIC_STRIPE_PUBLIC_KEY_DEV }}
tags: |
${{ secrets.REGISTRY_URL }}/uttarena/front:${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }}
deploy-prod:
if: ${{ github.event_name != 'pull_request' && (github.ref == 'refs/heads/master') }}
runs-on: self-hosted
needs:
- lint
- build
steps:
- uses: actions/checkout@v4
- name: Install docker
uses: docker/setup-buildx-action@v3
- name: Login to registry
uses: docker/login-action@v3
with:
type: ${{ job.status }}
job_name: '*Deployment to ${{ env.RESOURCE_NAME }}*'
commit: true
url: ${{ secrets.SLACK_WEBHOOK_URL }}
token: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
build-args: |
NEXT_PUBLIC_API_URL=${{ secrets.NEXT_PUBLIC_API_URL }}
NEXT_PUBLIC_UPLOADS_URL=${{ secrets.NEXT_PUBLIC_UPLOADS_URL }}
NEXT_PUBLIC_GOOGLE_VERIFICATION=${{ secrets.NEXT_PUBLIC_GOOGLE_VERIFICATION }}
NEXT_PUBLIC_URL=${{ secrets.NEXT_PUBLIC_URL }}
NEXT_PUBLIC_STRIPE_PUBLIC_KEY=${{ secrets.NEXT_PUBLIC_STRIPE_PUBLIC_KEY }}
tags: |
${{ secrets.REGISTRY_URL }}/uttarena/front:${{ github.ref == 'refs/heads/master' && 'master' || 'dev' }}
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
FROM node:18 AS base

ARG NEXT_PUBLIC_API_URL=http://localhost:3000
ARG NEXT_PUBLIC_UPLOADS_URL=https://arena.dev.uttnetgroup.fr/uploads/files
ARG ROBOTS_INDEX=enabled
ARG NEXT_PUBLIC_GOOGLE_VERIFICATION=
ARG NEXT_PUBLIC_URL=http://localhost:8080
ARG NEXT_PUBLIC_STRIPE_PUBLIC_KEY=

ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_UPLOADS_URL=$NEXT_PUBLIC_UPLOADS_URL
ENV ROBOTS_INDEX=$ROBOTS_INDEX
ENV NEXT_PUBLIC_GOOGLE_VERIFICATION=$NEXT_PUBLIC_GOOGLE_VERIFICATION
ENV NEXT_PUBLIC_URL=$NEXT_PUBLIC_URL
ENV NEXT_PUBLIC_STRIPE_PUBLIC_KEY=$NEXT_PUBLIC_STRIPE_PUBLIC_KEY

RUN npm install -g pnpm

FROM base AS builder
Expand Down
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const Home = () => {
<BoxContainer title="chiffres.txt" className={styles.boxContainer}>
<Counter value={6} name="Tournois" className={styles.sideCounter} />
<VerticalDivider className={styles.divider} />
<Counter value={4750} valueText=" €" name="de cashprize" className={styles.middleCounter} />
<Counter value={4900} valueText=" €" name="de cashprize" className={styles.middleCounter} />
<VerticalDivider className={styles.divider} />
<Counter value={416} name="Participants" className={styles.sideCounter} />
</BoxContainer>
Expand Down

0 comments on commit 0936c17

Please sign in to comment.