Skip to content

correction et remise au propre des pages événements et reward #9

correction et remise au propre des pages événements et reward

correction et remise au propre des pages événements et reward #9

Workflow file for this run

name: Production Deployment
on:
push:
branches:
- main
jobs:
create-environment:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: satsquare_user
POSTGRES_PASSWORD: satsquare_password
POSTGRES_DB: satsquare_db
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U satsquare_user"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Run database migrations
run: npx prisma db push
env:
DATABASE_URL: postgresql://satsquare_user:satsquare_password@localhost:5432/satsquare_db
- name: Seed the database
run: npx prisma seed
env:
DATABASE_URL: postgresql://satsquare_user:satsquare_password@localhost:5432/satsquare_db
test:
needs: create-environment
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
security:
needs: create-environment
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm install
- name: Run security checks
run: npm audit --audit-level=moderate
deploy:
needs: [create-environment, test, security]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USERNAME }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push Docker image
run: |
docker buildx build --push --tag ghcr.io/${{ github.repository }}/nextjs-app:latest .
- name: Deploy to production
run: |
docker-compose down
docker-compose pull
docker-compose up --build -d
env:
DATABASE_URL: postgresql://satsquare_user:satsquare_password@db:5432/satsquare_db
- name: Notification Discord
uses: nobrayner/discord-webhook@v1
needs: [build, test]

Check failure on line 118 in .github/workflows/prod.yaml

View workflow run for this annotation

GitHub Actions / Production Deployment

Invalid workflow file

The workflow is not valid. .github/workflows/prod.yaml (Line: 118, Col: 9): Unexpected value 'needs'
if: always()
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}
username: 'Bob'
avatar-url: 'https://octodex.github.com/images/Terracottocat_Single.png'
title: '${{ github.workflow }}: {{STATUS}}'
description: '${{ github.event_name }} a déclenché cette {{STATUS}} !'
include-details: 'false'
color-success: '#4287f5'
color-failure: 'eb4034'
color-cancelled: '0x42daf5'
footer: 'Bob le Constructeur'
- name: Notify
uses: nobrayner/discord-webhook@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
discord-webhook: ${{ secrets.DISCORD_WEBHOOK }}
username: 'Bob'
avatar-url: 'https://octodex.github.com/images/Terracottocat_Single.png'
title: '${{ github.workflow }}: {{STATUS}}'
description: '${{ github.event_name }} trigged this {{STATUS}}!'
include-details: 'false'
color-success: '#4287f5'
color-failure: 'eb4034'
color-cancelled: '0x42daf5'
footer: 'Bob the Builder'