Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
mwangggg committed Nov 2, 2023
1 parent d9331f4 commit 870d596
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI build and push

concurrency:
group: ci-${{ github.run_id }}
cancel-in-progress: true

on:
push:
branches:
- main
- v[0-9]+
- v[0-9]+.[0-9]+
- cryostat-v[0-9]+.[0-9]+

jobs:
build:
runs-on: ubuntu-latest
env:
CRYOSTAT_GRAFANA_IMG: quay.io/cryostat/cryostat-grafana-dashboard
REF_NAME: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v2
- name: Install qemu
continue-on-error: false
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Check release branch
id: check-branch
run: |
if [[ ${REF_NAME} == cryostat-v* ]]; then
echo "image-tag=${REF_NAME:10}" >> $GITHUB_OUTPUT
else
echo "image-tag=${REF_NAME}" >> $GITHUB_OUTPUT
fi
- name: Check commit git tag
id: commit-tag
run: |
output=$(git describe --tags --exact-match 2>/dev/null || echo -n '')
echo "::set-output name=image-tag::$output"
- name: Build container images and manifest
id: buildah-build
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.CRYOSTAT_GRAFANA_IMG }}
archs: amd64, arm64
tags: ${{ steps.check-branch.outputs.image-tag }} ${{ github.ref == 'refs/heads/main' && 'latest' || '' }} ${{ steps.commit-tag.outputs.image-tag }}
containerfiles: |
./Dockerfile
- name: Push to quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: cryostat-grafana-dashboard
tags: ${{ steps.buildah-build.outputs.tags }}
registry: quay.io/cryostat
username: cryostat+bot
password: ${{ secrets.REGISTRY_PASSWORD }}
if: ${{ github.repository_owner == 'cryostatio' }}
- name: Print image URL
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
if: ${{ github.repository_owner == 'cryostatio' }}

0 comments on commit 870d596

Please sign in to comment.