-
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.
chore: [CP-603] First attempt at setting up release flow
- Loading branch information
1 parent
d55e615
commit fc2a7b5
Showing
4 changed files
with
155 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,51 @@ | ||
name: Docker Build Test | ||
|
||
on: | ||
pull_request: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
env: | ||
AWS_REGION: "us-west-2" | ||
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}" | ||
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | ||
GITHUB_PAT: "${{ secrets.KIVA_ROBOT_GITHUB_PAT }}" | ||
SLACK_BOT_TOKEN: "${{ secrets.SLACK_TOKEN }}" | ||
SLACK_CHANNEL: "eng-build-failures" | ||
|
||
jobs: | ||
# Test that the image actually builds on each commit | ||
build-push-test: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' | ||
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: ui-static | ||
patterns: | | ||
resources/org/kiva/marketplaceWebUiCi/ui | ||
- name: move files | ||
run: | | ||
mv .docker/resources/org/kiva/marketplaceWebUiCi/ui/Dockerfile . | ||
cp -aRv .docker/resources/org/kiva/marketplaceWebUiCi/ui/config . | ||
- name: docker-build | ||
uses: ./.github/actions/docker-build-push | ||
if: github.event_name == 'pull_request' | ||
with: | ||
build_args: | | ||
TARGET_ENV=dev | ||
dockerfile_target: "release" | ||
push: false |
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,34 @@ | ||
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 | ||
uses: ./.github/actions/create-release | ||
env: | ||
GITHUB_PAT: ${{ secrets.KIVA_ROBOT_GITHUB_PAT }} | ||
with: | ||
environment: ${{ github.event.inputs.environment }} |
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,47 @@ | ||
name: Docker Build Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
push: | ||
branches: | ||
- main | ||
|
||
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: | ||
# Build and push the image to ECR | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
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 | ||
patterns: | | ||
resources/org/kiva/marketplaceWebUiCi/ui | ||
- name: move files | ||
run: | | ||
mv .docker/resources/org/kiva/marketplaceWebUiCi/ui/Dockerfile . | ||
cp -aRv .docker/resources/org/kiva/marketplaceWebUiCi/ui/config . | ||
- name: docker-push | ||
uses: ./.github/actions/docker-build-push | ||
with: | ||
dockerfile_target: "release" | ||
push: true |