forked from powerhouse-inc/switchboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
14 additions
and
108 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 |
---|---|---|
|
@@ -2,115 +2,21 @@ name: Deploy Switchboard Staging | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [feat/documentDrive, main] | ||
jobs: | ||
build: | ||
name: build and push to ghcr | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to GitHub Packages | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.GH_SIDSTRM_BUILD_AND_DEPLOY_USER }} | ||
password: ${{ secrets.GH_SIDSTRM_BUILD_AND_DEPLOY_TOKEN }} | ||
|
||
- name: Set outputs | ||
id: vars | ||
run: echo "git_hash_short=$(git rev-parse --short ${GITHUB_SHA})" >> $GITHUB_OUTPUT | ||
|
||
- name: Build and Push switchboard-api | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./api | ||
platforms: linux/amd64 | ||
push: true | ||
tags: | | ||
ghcr.io/sidestream-tech/switchboard/api:main | ||
ghcr.io/sidestream-tech/switchboard/api:${{ github.sha }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Build and Push switchboard-wundergraph | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./wundergraph | ||
platforms: linux/amd64 | ||
push: true | ||
tags: | | ||
ghcr.io/sidestream-tech/switchboard/wundergraph:main | ||
ghcr.io/sidestream-tech/switchboard/wundergraph:${{ github.sha }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Build and Push switchboard-frontend | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
file: ./frontend/Dockerfile | ||
platforms: linux/amd64 | ||
push: true | ||
tags: | | ||
ghcr.io/sidestream-tech/switchboard/frontend:main | ||
ghcr.io/sidestream-tech/switchboard/frontend:${{ github.sha }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
deploy: | ||
name: deploy staging to sidestream cluster | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout k8s-projects Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: sidestream-tech/k8s-projects | ||
token: ${{ secrets.GH_SIDSTRM_BUILD_AND_DEPLOY_TOKEN }} | ||
path: k8s-projects | ||
ref: main | ||
|
||
- uses: benjlevesque/[email protected] | ||
id: short-sha | ||
with: | ||
length: 6 | ||
|
||
- name: Update Value File API | ||
uses: mikefarah/yq@master | ||
with: | ||
cmd: yq -i '(.image.tag ="${{ github.sha }}") | (.commitShortSHA ="${{ github.sha }}") | (.releaseTag ="${{ github.ref_name }}")' $VALUES_FILE | ||
env: | ||
VALUES_FILE: "k8s-projects/switchboard-api/staging/values-api.yml" | ||
|
||
- name: Update Value File Wundergraph | ||
uses: mikefarah/yq@master | ||
with: | ||
cmd: yq -i '(.image.tag ="${{ github.sha }}") | (.commitShortSHA ="${{ github.sha }}") | (.releaseTag ="${{ github.ref_name }}")' $VALUES_FILE | ||
env: | ||
VALUES_FILE: "k8s-projects/switchboard-api/staging/values-wundergraph.yml" | ||
|
||
- name: Update Value File Frontend | ||
uses: mikefarah/yq@master | ||
with: | ||
cmd: yq -i '(.image.tag ="${{ github.sha }}") | (.commitShortSHA ="${{ github.sha }}") | (.releaseTag ="${{ github.ref_name }}")' $VALUES_FILE | ||
env: | ||
VALUES_FILE: "k8s-projects/switchboard-api/staging/values-frontend.yml" | ||
# Check-out your repository. | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Commit & Push changes | ||
uses: actions-js/push@master | ||
- name: Build, Push and Release API to Heroku. # Your custom step name | ||
uses: gonuit/[email protected] | ||
with: | ||
github_token: ${{ secrets.GH_SIDSTRM_BUILD_AND_DEPLOY_TOKEN }} | ||
repository: sidestream-tech/k8s-projects | ||
branch: main | ||
message: "[ArgoCD]: ${{ github.workflow }} to `${{ steps.short-sha.outputs.sha }}` :rocket:" | ||
directory: k8s-projects | ||
email: ${{ secrets.HEROKU_EMAIL }} | ||
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} | ||
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }} | ||
dockerfile_directory: ./api | ||
dockerfile_name: Dockerfile | ||
process_type: web |
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
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