Skip to content

Fix/image link user/reservation #195

Fix/image link user/reservation

Fix/image link user/reservation #195

Workflow file for this run

# test if ci
name: test-ci
on:
push: # Lors du push sur toutes les branches
branches:
- "*"
pull_request:
branches:
[develop,main]
jobs:
ESLint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '20'
- name: install
run: cd backend && npm i
- name: ESLint init and run fix
run: cd backend && npm init && npm run fix .
- name: Prettier
run: cd backend && npx prettier --write .
test-back:
needs: ESLint
runs-on: ubuntu-latest
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres
# Provide the password for postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: snowwild
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Goto back and run tests
run: cd backend && npm i && npm run testCI
docker:
needs: test-back
# if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
context: "{{defaultContext}}:backend"
tags: ${{ secrets.DOCKERHUB_USERNAME }}/backend:latest