generated from openshift/console-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #123 from jasonmadigan/main
main
- Loading branch information
Showing
4 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |