Skip to content

Merge pull request #4 from podmortem/feat/rest #6

Merge pull request #4 from podmortem/feat/rest

Merge pull request #4 from podmortem/feat/rest #6

Workflow file for this run

name: CI for Native Docker Image
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-build:
name: Test Build on Pull Request
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build Docker image for testing
uses: docker/build-push-action@v6
with:
context: .
file: ./src/main/docker/Dockerfile.native
push: false
build-args: |
GITHUB_USER=${{ github.actor }}
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
build-and-push:
name: Build and Push on Main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_PAT }}
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
context: .
file: ./src/main/docker/Dockerfile.native
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:latest
ghcr.io/${{ github.repository_owner }}/podmortem-log-parser:${{ github.sha }}
build-args: |
GITHUB_USER=${{ github.actor }}
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}