-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (44 loc) · 1.38 KB
/
ci.yaml
File metadata and controls
56 lines (44 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: CI
on:
push:
branches: [ "main" ]
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
pull_request:
branches: [ "main" ]
env:
REGISTRY: docker.io
DOCKER_USERNAME: argentinaluiz
IMAGE_NAME: argentinaluiz/docker-prod-test
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Build for CI
id: build-ci
uses: docker/build-push-action@v5.0.0
with:
context: ./src/ci/nestjs-project
file: ./src/ci/nestjs-project/Dockerfile.prod
push: false
load: true # driver docker-container
target: ci
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:ci
cache-from: type=gha
cache-to: type=gha,mode=max
secrets: |
github_token=${{ secrets.MY_GITHUB_TOKEN }}
- name: Up containers
run: docker compose -f ./src/ci/nestjs-project/compose.ci.yaml up -d --wait-timeout 10
- name: Run tests
run: echo "Running tests..."