Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

actions: fixup #123

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build and Push Image

on:
push:
branches:
- main # only for merges/pushes to main

env:
REGISTRY_USER: ${{ secrets.QUAY_USER }}
IMAGE_REGISTRY: quay.io
REGISTRY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}

jobs:
build:
name: Build and push image
runs-on: ubuntu-22.04

steps:
- name: Log in to Quay.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}

- uses: actions/checkout@v4

- name: Build Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: quay.io/kuadrant/console-plugin
tags: |
latest
${{ github.sha }}
containerfiles: |
./Dockerfile

- name: Push To Quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
registry: quay.io
image: kuadrant/console-plugin
tags: |
latest
${{ github.sha }}

- name: Print image URL
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
23 changes: 23 additions & 0 deletions .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Add issues to project

on:
issues:
types:
- opened
pull_request:
types:
- opened

jobs:
add-to-project:
name: Add issue to project
# Only run jobs if the feature branch is in your repo (not in a fork)
# OR
# it is an issue
if: github.event.pull_request.head.repo.full_name == github.repository || github.event.issue.number != ''
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
project-url: https://github.com/orgs/Kuadrant/projects/18
github-token: ${{ secrets.ADD_ISSUES_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint Check

on:
# pull_request:
# branches:
# - '**'
workflow_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'

- name: Install dependencies
run: yarn install

- name: Run lint
run: yarn lint

- name: Check for changes
run: |
if [[ $(git status --porcelain) ]]; then
echo "Linting caused changes, failing the build."
exit 1
else
echo "No changes detected."
fi
51 changes: 51 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build and Push Versioned Image

on:
release:
types: [published]

env:
REGISTRY_USER: ${{ secrets.QUAY_USER }}
IMAGE_REGISTRY: quay.io
REGISTRY_PASSWORD: ${{ secrets.QUAY_PASSWORD }}

jobs:
release:
name: Build and push versioned image
runs-on: ubuntu-22.04

steps:
- name: Debug release name
run: echo "Versioned image pushed to ${{ github.event.release.name }}"

- name: Log in to Quay.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}
registry: ${{ env.IMAGE_REGISTRY }}

- uses: actions/checkout@v4

- name: Build Image for Release
id: build-release-image
uses: redhat-actions/buildah-build@v2
with:
image: quay.io/kuadrant/console-plugin
tags: |
${{ github.event.release.name }}
containerfiles: |
./Dockerfile

- name: Push To Quay.io for Release
id: push-release-to-quay
uses: redhat-actions/push-to-registry@v2
with:
registry: quay.io
image: kuadrant/console-plugin
# Use release name for quay tag, rather than tag_name (so we can do RCs/pre-releases)
tags: |
${{ github.event.release.name }}

- name: Print image URL for Release
run: echo "Versioned image pushed to ${{ steps.push-release-to-quay.outputs.registry-paths }}"