build-test-image.yml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. name: Build and Publish Test Image
  2. on:
  3. merge_group:
  4. types: [checks_requested]
  5. env:
  6. REGISTRY: ghcr.io
  7. jobs:
  8. build-and-publish-test-image:
  9. runs-on: ubuntu-latest
  10. permissions:
  11. contents: read
  12. packages: write
  13. steps:
  14. - name: Checkout Repo
  15. uses: actions/checkout@v4
  16. with:
  17. ref: ${{ github.event.merge_group.head_sha }}
  18. - name: Set SHA
  19. id: sha
  20. run: |
  21. echo "OC_SHORTHASH=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
  22. - name: Set OpenCost Image Tags
  23. id: tags
  24. run: |
  25. echo "IMAGE_TAG=ghcr.io/${{ github.repository_owner }}/opencost:test-${{ steps.sha.outputs.OC_SHORTHASH }}" >> $GITHUB_OUTPUT
  26. - name: Build and publish container
  27. uses: ./.github/actions/build-container
  28. with:
  29. actor: ${{ github.actor }}
  30. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  31. image_tag: ${{ steps.tags.outputs.IMAGE_TAG }}
  32. release_version: test-${{ steps.sha.outputs.OC_SHORTHASH }}