-
Notifications
You must be signed in to change notification settings - Fork 2
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
34 changed files
with
1,836 additions
and
1,041 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.env* | ||
.pre-commit-config.yaml | ||
*.example | ||
*.example | ||
target/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: k8s-deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- k8s-deploy | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
production-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out latest commit | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: osuAkatsuki/performance-service | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKERHUB_USERNAME }}/performance-service:latest | ||
${{ secrets.DOCKERHUB_USERNAME }}/performance-service:${{ github.sha }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Get kubeconfig from github secrets | ||
run: | | ||
mkdir -p $HOME/.kube | ||
echo "${{ secrets.KUBECONFIG }}" > $HOME/.kube/config | ||
sudo chown $(id -u):$(id -g) $HOME/.kube/config | ||
- name: Install helm | ||
uses: azure/setup-helm@v3 | ||
with: | ||
version: "latest" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
id: install | ||
|
||
- name: Install helm-diff | ||
run: helm plugin install https://github.com/databus23/helm-diff | ||
|
||
- name: Checkout common-helm-charts repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: osuAkatsuki/common-helm-charts | ||
token: ${{ secrets.COMMON_HELM_CHARTS_PAT }} | ||
path: common-helm-charts | ||
|
||
- name: Show manifest diff since previous release | ||
run: | | ||
helm diff upgrade \ | ||
--allow-unreleased \ | ||
--values chart/values.yaml \ | ||
performance-service-production \ | ||
common-helm-charts/microservice-base/ | ||
- name: Deploy service to production cluster | ||
run: | | ||
helm upgrade \ | ||
--install \ | ||
--atomic \ | ||
--wait --timeout 480s \ | ||
--values chart/values.yaml \ | ||
performance-service-production \ | ||
common-helm-charts/microservice-base/ |
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 |
---|---|---|
@@ -1,25 +1,26 @@ | ||
name: production-deploy | ||
on: | ||
push: | ||
branches: | ||
- main | ||
# TODO: fix production deploys | ||
# name: production-deploy | ||
# on: | ||
# push: | ||
# branches: | ||
# - main | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Run deploy on production | ||
uses: appleboy/ssh-action@v1.0.0 | ||
with: | ||
host: ${{ secrets.SSH_HOST }} | ||
username: ${{ secrets.SSH_USERNAME }} | ||
key: ${{ secrets.SSH_KEY }} | ||
port: ${{ secrets.SSH_PORT }} | ||
script_stop: true | ||
script: | | ||
cd /home/akatsuki/performance-service | ||
git pull origin main | ||
docker build -t performance-service:latest . | ||
cd /home/akatsuki/workbench | ||
docker-compose restart performance-service-api performance-service-processor | ||
# jobs: | ||
# build: | ||
# name: Build | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Run deploy on production | ||
# uses: appleboy/ssh-action@v1.0.0 | ||
# with: | ||
# host: ${{ secrets.SSH_HOST }} | ||
# username: ${{ secrets.SSH_USERNAME }} | ||
# key: ${{ secrets.SSH_KEY }} | ||
# port: ${{ secrets.SSH_PORT }} | ||
# script_stop: true | ||
# script: | | ||
# cd /home/akatsuki/performance-service | ||
# git pull origin main | ||
# docker build -t performance-service:latest . | ||
# cd /home/akatsuki/workbench | ||
# docker-compose restart performance-service-api performance-service-processor |
Oops, something went wrong.