Skip to content

[integration-test] Only build on pushes to the main branch #5

[integration-test] Only build on pushes to the main branch

[integration-test] Only build on pushes to the main branch #5

name: Integration Test Image
on:
push:
branches: [trunk]
paths:
- 'integration-test/**'
- '.github/workflows/integration-test.yml'
pull_request:
paths:
- 'integration-test/**'
- '.github/workflows/integration-test.yml'
release:
types: [published]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: integration-test
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup environment
run: |
TAG=$(echo $GITHUB_REF | cut -d / -f 3)
echo "GHCR_TAG=ghcr.io/${{github.repository}}/circt-integration-test:$TAG" >> $GITHUB_ENV
- name: Build image
run: docker build . --tag $GHCR_TAG
- name: Push image
if: ${{ github.event_name == 'release' }}
run: |
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker push $GHCR_TAG