-
Notifications
You must be signed in to change notification settings - Fork 8
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 #5040 from kiva/chore-CP-603-github-actions
chore: [CP-603] First attempt at setting up release flow
- Loading branch information
Showing
3 changed files
with
149 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,42 @@ | ||
name: create-release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: choice | ||
description: 'Environment to release to (staging or production)' | ||
options: | ||
- staging | ||
- production | ||
required: true | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout-repo | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
- name: checkout-actions | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: kiva/github-actions | ||
token: ${{ secrets.KIVA_ROBOT_GITHUB_PAT }} | ||
path: .github/ | ||
- name: create-release | ||
id: release | ||
uses: ./.github/actions/create-release | ||
env: | ||
GITHUB_PAT: ${{ secrets.KIVA_ROBOT_GITHUB_PAT }} | ||
with: | ||
environment: ${{ github.event.inputs.environment }} | ||
write_to_file: "true" | ||
- name: update-package-file | ||
uses: ./.github/actions/semantic-package-json-update | ||
env: | ||
GITHUB_PAT: ${{ secrets.KIVA_ROBOT_GITHUB_PAT }} | ||
with: | ||
new_version: ${{ steps.release.outputs.tag }} |
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: Lint PR (semantic title) | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- edited | ||
|
||
jobs: | ||
lint-title: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: kiva/github-actions | ||
token: ${{ secrets.KIVA_ROBOT_GITHUB_PAT }} | ||
path: .github/ | ||
- name: lint-pr | ||
uses: ./.github/actions/lint-pr | ||
env: | ||
GITHUB_PAT: ${{ secrets.KIVA_ROBOT_GITHUB_PAT }} |
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,84 @@ | ||
name: Docker Build Publish | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]+-rc*' | ||
|
||
env: | ||
GITHUB_PAT: "${{ secrets.KIVA_ROBOT_GITHUB_PAT }}" | ||
AWS_REGION: "us-west-2" | ||
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}" | ||
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | ||
SLACK_BOT_TOKEN: "${{ secrets.SLACK_TOKEN }}" | ||
SLACK_CHANNEL: "eng-build-failures" | ||
|
||
jobs: | ||
test-build: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
env: | ||
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}" | ||
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: kiva/github-actions | ||
token: ${{ env.GITHUB_PAT }} | ||
path: .github/ | ||
- uses: snow-actions/[email protected] | ||
with: | ||
repository: kiva/marketplace-web-ui-ci | ||
token: ${{ env.GITHUB_PAT }} | ||
path: .docker | ||
ref: main | ||
patterns: | | ||
resources/org/kiva/marketplaceWebUiCi/ui | ||
- name: move files | ||
run: | | ||
mv .docker/resources/org/kiva/marketplaceWebUiCi/ui/Dockerfile . | ||
- name: docker-build | ||
uses: ./.github/actions/docker-build-push | ||
if: github.event_name == 'pull_request' | ||
with: | ||
dockerfile_target: "release" | ||
push: false | ||
# Build and push the image to ECR | ||
build: | ||
runs-on: ubuntu-latest | ||
# Run on merges to development or tag pushes (done by create-release workflow) | ||
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags') | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Checkout actions | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: kiva/github-actions | ||
token: ${{ env.GITHUB_PAT }} | ||
path: .github/ | ||
- uses: snow-actions/[email protected] | ||
with: | ||
repository: kiva/marketplace-web-ui-ci | ||
token: ${{ env.GITHUB_PAT }} | ||
path: .docker | ||
ref: main | ||
patterns: | | ||
resources/org/kiva/marketplaceWebUiCi/ui | ||
- name: move files | ||
run: | | ||
mv .docker/resources/org/kiva/marketplaceWebUiCi/ui/Dockerfile . | ||
- name: docker-push | ||
uses: ./.github/actions/docker-build-push | ||
with: | ||
dockerfile_target: "release" | ||
push: true |