Skip to content

WIP: implement clearer tagging system #3

WIP: implement clearer tagging system

WIP: implement clearer tagging system #3

Workflow file for this run

# name: Deploy To Prodcution
# on:
# release:
# types: [released]
name: test-wf
on:
pull_request:
branches:
- main
env:
GHCR_REGISTRY: ghcr.io
GHCR_UI_IMAGE_NAME: ${{ github.repository }}/ui
QUAY_REGISTRY: quay.io
QUAY_UI_IMAGE_NAME: instructlab-ui/ui
GHCR_PATHSERVICE_IMAGE_NAME: ${{ github.repository }}/pathservice
QUAY_PATHSERVICE_IMAGE_NAME: instructlab-ui/pathservice
jobs:
check_most_recent_pr_number:
runs-on: ubuntu-latest
steps:
- name: Get Pull Request Number
id: get_pr_number
uses: actions/github-script@v6
with:
script: |
const pr = await github.rest.pulls.list({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed',
head: `${context.repo.owner}:${process.env.GITHUB_HEAD_REF}`,
per_page: 1
});
if (pr.data.length > 0) {
return pr.data[0].number;
}
return '';
result-encoding: string
- name: Build and Tag Docker Image
if: steps.get_pr_number.outputs.result != ''
env:
PR_NUMBER: ${{ steps.get_pr_number.outputs.result }}
run: |
echo my-image:pr-${PR_NUMBER}