Skip to content

Merge pull request #141 from WildCodeSchool/56/delete-article #124

Merge pull request #141 from WildCodeSchool/56/delete-article

Merge pull request #141 from WildCodeSchool/56/delete-article #124

name: frontend-tests-workflow
on: push
jobs:
test-client:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Goto frontend and run tests
run: cd frontend && npm i && npm test
test-e2e:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: run e2e tests
run: docker compose -f docker-compose.e2e.yml up --build --exit-code-from e2e
docker-build-and-push-to-dockerhub:
needs: [test-client, test-e2e]
if: github.ref == 'refs/heads/dev'
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 frontend
uses: docker/build-push-action@v4
with:
push: true
context: "{{defaultContext}}:frontend"
file: Dockerfile.prod
tags: ${{ secrets.DOCKERHUB_USERNAME }}/wildrent-frontend:latest, ${{ secrets.DOCKERHUB_USERNAME }}/wildrent-frontend:${{ github.sha }}
- name: Build and push backend
uses: docker/build-push-action@v4
with:
push: true
context: "{{defaultContext}}:backend"
file: Dockerfile.prod
tags: ${{ secrets.DOCKERHUB_USERNAME }}/wildrent-backend:latest, ${{ secrets.DOCKERHUB_USERNAME }}/wildrent-backend:${{ github.sha }}
- name: Build and push img
uses: docker/build-push-action@v4
with:
push: true
context: "{{defaultContext}}:img"
file: Dockerfile.prod
tags: ${{ secrets.DOCKERHUB_USERNAME }}/wildrent-img:latest, ${{ secrets.DOCKERHUB_USERNAME }}/wildrent-img:${{ github.sha }}