Skip to content

QA: Streamline build process for easier manual and automated tested #9

QA: Streamline build process for easier manual and automated tested

QA: Streamline build process for easier manual and automated tested #9

Workflow file for this run

name: Build PR
on:
pull_request:
# pull_request_review:
# types: [submitted]
jobs:
build:
name: Build PR container
if: github.repository == 'xibosignage/xibo-cms'
# if: github.repository == 'xibosignage/xibo-cms' && github.event.review.state == 'APPROVED'
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Configure Build X
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Container
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ghcr.io/${{ github.actor }}/xibo-cms:pr-${{ github.event.pull_request.number }}
build-args: GIT_COMMIT=${{ github.event.head.sha }}
push: true
load: false
- name: Update PR with Package name
uses: actions/github-script@v6
with:
script: |
const body = 'Image ready at ghcr.io/${{ github.actor }}/xibo-cms:pr-${{ github.event.pull_request.number }}';
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
})