Skip to content

Commit

Permalink
Restructure workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
VOID404 committed Sep 7, 2024
1 parent 2cf3e44 commit e883854
Showing 1 changed file with 46 additions and 15 deletions.
61 changes: 46 additions & 15 deletions .github/workflows/gha-summarizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,64 @@ on:
paths-ignore:
- "README.md"
- "LICENSE"
pull_request:
branches:
- main
paths-ignore:
- "README.md"
- "LICENSE"
env:
image: ghcr.io/${{ github.repository }}/gha-summarizer

jobs:
build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
outputs:
imageid: ${{ steps.docker_metadata.outputs.imageid }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Set up Docker metadata
id: docker_metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.image }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=ref,event=tag
type=sha
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request_target' }}
tags: ${{ steps.docker_metadata.outputs.tags }}
labels: ${{ steps.docker_metadata.outputs.labels }}

test:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}

- name: Render template
uses: ./
uses: docker://ghcr.io/void404/gha-summarizer/gha-summarizer@main
with:
template: example/template.md
out-file: out.md

- name: Debug ls
if: always()
run: |
ls -la
ls -la ./gha-summarizer
args: example/template.md out.md

- name: Check if the rendered file is different
run: |
Expand Down

0 comments on commit e883854

Please sign in to comment.