Skip to content

Commit c9e53c5

Browse files
authored
Ensure gh action ends after quest run (#297)
1 parent 7876de0 commit c9e53c5

File tree

3 files changed

+54
-52
lines changed

3 files changed

+54
-52
lines changed

.github/workflows/build-push.yaml

Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,39 @@
1-
name: Integration tests
1+
name: Build and publish a Docker image to GHCR
22

33
on:
4-
pull_request:
5-
paths-ignore:
6-
- 'docs/**'
7-
- 'helm/**'
8-
- 'assets/**'
9-
- '**.md'
4+
push:
5+
branches: ['main']
106

117
env:
128
REGISTRY: ghcr.io
139
IMAGE_NAME: ${{ github.repository }}
1410

1511
jobs:
1612

17-
docker-compose-test:
18-
name: Docker Compose integration tests
13+
build-and-push-image:
14+
name: Build and push Docker image to GitHub Container Registry
1915
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
2019
steps:
21-
- name: Checkout
20+
- name: Checkout repository
2221
uses: actions/checkout@v3
23-
- name: Start compose
24-
run: docker-compose -f "docker-compose.yaml" up --build
25-
- name: Stop compose
26-
if: always()
27-
run: docker-compose -f "docker-compose.yaml" down
28-
29-
# docker-build:
30-
# name: Docker build
31-
# runs-on: ubuntu-latest
32-
# steps:
33-
# - name: Checkout
34-
# uses: actions/checkout@v3
35-
# - name: Build Docker image
36-
# run: docker build .
37-
38-
# build-and-push-image:
39-
# name: Build and push Docker image to GitHub Container Registry
40-
# runs-on: ubuntu-latest
41-
# permissions:
42-
# contents: read
43-
# packages: write
44-
# steps:
45-
# - name: Checkout repository
46-
# uses: actions/checkout@v3
47-
# - name: Log in to the Container registry
48-
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
49-
# with:
50-
# registry: ${{ env.REGISTRY }}
51-
# username: ${{ github.actor }}
52-
# password: ${{ secrets.GITHUB_TOKEN }}
53-
# - name: Extract metadata (tags, labels) for Docker
54-
# id: meta
55-
# uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
56-
# with:
57-
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
58-
# - name: Build and push Docker image
59-
# uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
60-
# with:
61-
# context: .
62-
# push: true
63-
# tags: ${{ steps.meta.outputs.tags }}
64-
# labels: ${{ steps.meta.outputs.labels }}
22+
- name: Log in to the Container registry
23+
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
24+
with:
25+
registry: ${{ env.REGISTRY }}
26+
username: ${{ github.actor }}
27+
password: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Extract metadata (tags, labels) for Docker
29+
id: meta
30+
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
31+
with:
32+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33+
- name: Build and push Docker image
34+
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
35+
with:
36+
context: .
37+
push: true
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Integration tests
2+
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- 'docs/**'
7+
- 'helm/**'
8+
- 'assets/**'
9+
- '**.md'
10+
11+
env:
12+
REGISTRY: ghcr.io
13+
IMAGE_NAME: ${{ github.repository }}
14+
15+
jobs:
16+
17+
docker-compose-test:
18+
name: Docker Compose integration tests
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
- name: Start compose
24+
run: docker-compose up --build --exit-code-from quest quest
25+
- name: Stop compose
26+
if: always()
27+
run: docker-compose down
File renamed without changes.

0 commit comments

Comments
 (0)