Skip to content

Commit

Permalink
fix: new one
Browse files Browse the repository at this point in the history
  • Loading branch information
olehbairak committed Jan 24, 2024
1 parent d059350 commit e764f5a
Showing 1 changed file with 52 additions and 15 deletions.
67 changes: 52 additions & 15 deletions .github/workflows/integration-tests-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,49 @@ name: Integration test - API
on: pull_request

jobs:
build_and_cache:
runs-on: ubuntu-latest

steps:
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Checkout Repository
uses: actions/checkout@v2

- name: Build Docker Image
run: docker build -t my-docker-image:latest .

- name: Cache Docker Image
uses: actions/cache@v2
with:
path: |
~/.docker
key: docker-image-${{ runner.os }}-${{ hashFiles('**/*.dockerfile') }}
if: success()

use_cached_docker_image:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Restore Cached Docker Image
uses: actions/cache@v2
with:
path: |
~/.docker
key: docker-image-${{ runner.os }}-${{ hashFiles('**/*.dockerfile') }}

#- name: Use Docker Image in Another Job
# run: |
# # Your commands to use the Docker image


runTests:
timeout-minutes: 30
runs-on: ubuntu-latest
Expand Down Expand Up @@ -29,15 +72,15 @@ jobs:
with:
fetch-depth: 0

- name: Cache Docker images
id: cache-docker-images
uses: actions/cache@v3
with:
path: |
~/.docker
key: ${{ runner.os }}-docker-${{ hashFiles('**/docker-compose.yaml') }}
restore-keys: |
${{ runner.os }}-docker-
# - name: Cache Docker images
# id: cache-docker-images
# uses: actions/cache@v3
# with:
# path: |
# ~/.docker
# key: ${{ runner.os }}-docker-${{ hashFiles('**/docker-compose.yaml') }}
# restore-keys: |
# ${{ runner.os }}-docker-

- name: Setup Node.js
uses: actions/setup-node@v3
Expand All @@ -50,12 +93,6 @@ jobs:
npm ci --no-audit
npx playwright install --with-deps chromium
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Start docker containers
run: |
docker-compose -f "docker-compose.yaml" up -d --build
Expand Down

0 comments on commit e764f5a

Please sign in to comment.