-
Notifications
You must be signed in to change notification settings - Fork 3
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
50 changed files
with
11,372 additions
and
13,482 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,48 @@ name: Deploy Switchboard Staging | |
|
||
on: | ||
push: | ||
branches: [ main ] | ||
branches: [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 | ||
# Check-out your repository. | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- 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 | ||
- name: Build, Push and Release API to Heroku. # Your custom step name | ||
uses: gonuit/[email protected] | ||
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 | ||
email: ${{ secrets.HEROKU_EMAIL }} | ||
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} | ||
heroku_app_name: ${{ secrets.HEROKU_API_NAME }} | ||
dockerfile_directory: ./api | ||
dockerfile_name: Dockerfile | ||
process_type: web | ||
- name: Build, Push and Release Frontend to Heroku. # Your custom step name | ||
uses: gonuit/[email protected] | ||
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 | ||
email: ${{ secrets.HEROKU_EMAIL }} | ||
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} | ||
heroku_app_name: ${{ secrets.HEROKU_FRONTEND_NAME }} | ||
dockerfile_directory: ./ | ||
dockerfile_name: frontend/Dockerfile | ||
process_type: web | ||
- name: Build, Push and Release Wundergraph to Heroku. # Your custom step name | ||
uses: gonuit/[email protected] | ||
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" | ||
|
||
- name: Commit & Push changes | ||
uses: actions-js/push@master | ||
email: ${{ secrets.HEROKU_EMAIL }} | ||
heroku_api_key: ${{ secrets.HEROKU_API_KEY }} | ||
heroku_app_name: ${{ secrets.HEROKU_WGRAPH_NAME }} | ||
dockerfile_directory: ./wundergraph | ||
dockerfile_name: Dockerfile | ||
process_type: web | ||
- name: Build, Push and Release NGINX 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_NGINX_NAME }} | ||
dockerfile_directory: ./nginx | ||
dockerfile_name: Dockerfile | ||
process_type: web |
File renamed without changes.
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 |
---|---|---|
|
@@ -18,3 +18,5 @@ coverage | |
|
||
# system-related | ||
.DS_Store | ||
|
||
.vscode |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.