Skip to content

Commit

Permalink
Reworked structure & added test build to PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianTrommer committed Oct 23, 2024
1 parent 7b8f96a commit bcac1a7
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: Build and push image

on:
workflow_run:
workflows: ["Check code format"]
types:
- completed
pull_request:
branches:
- "main"
push:
branches:
- main
Expand Down Expand Up @@ -43,8 +42,24 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Test build
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v3
with:
context: .
file: ./build/docker/agent/Dockerfile
load: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}:test
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
USERNAME=paf
USER_UID=1000
USER_GID=1000
- name: Build and push Docker image
id: build
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v3
with:
context: .
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/drive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
run: docker compose down -v
# add rendered JSON as comment to the pull request
- name: Add simulation results as comment
if: github.event_name == 'pull_request'
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Check code format

on:
workflow_run:
workflows: ["Linter markdown and code"]
types:
- completed
pull_request:
branches:
- "main"
push:
branches:
- main

jobs:
format:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
pull_request:
branches:
- "main"
push:
branches:
- main

jobs:
linter:
Expand Down

0 comments on commit bcac1a7

Please sign in to comment.