Skip to content

ci: adding release to pr build for testing #8

ci: adding release to pr build for testing

ci: adding release to pr build for testing #8

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.
name: Test Blog Docker image
on:
pull_request:
paths:
- "/blog"
- ".github/workflows/build-blog.yaml"
jobs:
build_image:
name: Build Docker image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ fromJson(env.BUILDCONFIG).platforms }}
- name: Build Docker image
id: push
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85
with:
context: ./blog
file: ./blog/Dockerfile
# platforms: linux/amd64,linux/arm64
push: false
test_deploy:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
path: [blog]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Loading buildconfig.json into env.BUILDCONFIG
run: echo "BUILDCONFIG=$(jq -c . < ${{ matrix.path }}/buildconfig.json)" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: ${{ fromJson(env.BUILDCONFIG).platforms }}
- name: Parse Semver
id: semver
uses: booxmedialtd/[email protected]
with:
input_string: ${{ fromJson(env.BUILDCONFIG).version }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/hyperfluid-solutions/${{ matrix.path }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}},value=${{ fromJson(env.BUILDCONFIG).version }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.semver.outputs.major }}.${{ steps.semver.outputs.minor }}
type=semver,pattern={{major}},value=${{ steps.semver.outputs.major }}
type=sha
# Predefined Annotation Keys:
# https://github.com/opencontainers/image-spec/blob/main/annotations.md#pre-defined-annotation-keys
labels: |
org.opencontainers.image.name=${{ matrix.path }}
org.opencontainers.image.licenses=MIT
org.opencontainers.image.vendor=Hyperfluid Solutions Corp.
org.opencontainers.image.version=${{ fromJson(env.BUILDCONFIG).version }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.url=https://github.com/hyperfluid-solutions/baseimages/releases/tag/${{ matrix.path }}-v${{ fromJson(env.BUILDCONFIG).version }}
org.opencontainers.image.source=https://github.com/hyperfluid-solutions/baseimages
org.opencontainers.image.title=${{ matrix.path }}
org.opencontainers.image.documentation=https://github.com/hyperfluid-solutions/baseimages/blob/main/${{ fromJson(env.BUILDCONFIG).documentation }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./${{ matrix.path }}
file: ./${{ matrix.path }}/Dockerfile
platforms: ${{ fromJson(env.BUILDCONFIG).platforms }}
push: false
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}