Skip to content

Commit

Permalink
chore: [CP-603] First attempt at setting up release flow
Browse files Browse the repository at this point in the history
  • Loading branch information
kathrynlovett committed Oct 19, 2023
1 parent d55e615 commit fc2a7b5
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-push-test.yaml
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
34 changes: 34 additions & 0 deletions .github/workflows/create-release.yaml
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 }}
23 changes: 23 additions & 0 deletions .github/workflows/lint-name.yaml
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 }}
47 changes: 47 additions & 0 deletions .github/workflows/release-build.yaml
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

0 comments on commit fc2a7b5

Please sign in to comment.