Skip to content

Commit

Permalink
Merge pull request #4 from fix/upgrade-workflows
Browse files Browse the repository at this point in the history
Fix/upgrade workflows
  • Loading branch information
ayoub3bidi authored Feb 24, 2024
2 parents 86ea850 + 98c7ff3 commit 9d5755d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 11 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Push Docker Image

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- 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.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ayoub3bidi/mercury:latest
22 changes: 11 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Unit and Integration Tests

on:
push:
Expand All @@ -19,11 +19,11 @@ jobs:

- name: Create environment file
run: |
echo "POSTGRES_HOST=${{ secrets.POSTGRES_HOST }}" > .env
echo "POSTGRES_PORT=${{ secrets.POSTGRES_PORT }}" >> .env
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> .env
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
echo "POSTGRES_HOST=${{ env.POSTGRES_HOST }}" > .env
echo "POSTGRES_PORT=${{ env.POSTGRES_PORT }}" >> .env
echo "POSTGRES_DB=${{ env.POSTGRES_DB }}" >> .env
echo "POSTGRES_USER=${{ env.POSTGRES_USER }}" >> .env
echo "POSTGRES_PASSWORD=${{ env.POSTGRES_PASSWORD }}" >> .env
- name: Run integration tests
run: |
Expand All @@ -37,11 +37,11 @@ jobs:

- name: Create environment file
run: |
echo "POSTGRES_HOST=${{ secrets.POSTGRES_HOST }}" > .env
echo "POSTGRES_PORT=${{ secrets.POSTGRES_PORT }}" >> .env
echo "POSTGRES_DB=${{ secrets.POSTGRES_DB }}" >> .env
echo "POSTGRES_USER=${{ secrets.POSTGRES_USER }}" >> .env
echo "POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }}" >> .env
echo "POSTGRES_HOST=${{ env.POSTGRES_HOST }}" > .env
echo "POSTGRES_PORT=${{ env.POSTGRES_PORT }}" >> .env
echo "POSTGRES_DB=${{ env.POSTGRES_DB }}" >> .env
echo "POSTGRES_USER=${{ env.POSTGRES_USER }}" >> .env
echo "POSTGRES_PASSWORD=${{ env.POSTGRES_PASSWORD }}" >> .env
- name: Run unit tests
run: |
Expand Down

0 comments on commit 9d5755d

Please sign in to comment.