-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2942 from mitch1024/master
Refactor CICDs
- Loading branch information
Showing
15 changed files
with
1,959 additions
and
5,935 deletions.
There are no files selected for viewing
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
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,73 @@ | ||
name: Build and Deploy Docs | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
paths: [ "docs/**" ] | ||
|
||
jobs: | ||
setup-build-publish: | ||
name: Setup, Build and Publish | ||
runs-on: ubuntu-latest | ||
environment: production | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: 'docs/' | ||
sparse-checkout-cone-mode: false | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and Push Docker Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
file: ./docs/Dockerfile | ||
push: true | ||
tags: irisnet/docs:${{ github.sha }} | ||
|
||
deploy: | ||
name: Deploy | ||
runs-on: arc-runner-set | ||
environment: production | ||
|
||
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
|
||
steps: | ||
- name: 'Set up Google Cloud SDK' | ||
uses: 'google-github-actions/setup-gcloud@v2' | ||
with: | ||
version: '>= 363.0.0' | ||
install_components: "gke-gcloud-auth-plugin" | ||
|
||
- name: Set up Kubectl | ||
uses: azure/setup-kubectl@v3 | ||
with: | ||
version: 'v1.21.0' | ||
|
||
- name: Authenticate to Google Cloud | ||
uses: google-github-actions/auth@v2 | ||
with: | ||
project_id: ${{ secrets.GKE_PROJECT }} | ||
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENDITY_PROVIDER }} | ||
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }} | ||
token_format: 'access_token' | ||
|
||
- name: Set up GKE credentials | ||
uses: google-github-actions/get-gke-credentials@v2 | ||
with: | ||
cluster_name: ${{ secrets.GKE_CLUSTER }} | ||
location: ${{ secrets.GKE_REGION }} | ||
|
||
- name: Deploy to GKE | ||
run: | | ||
gcloud container clusters get-credentials app --region ${{ secrets.GKE_REGION }} --project ${{ secrets.GKE_PROJECT }} | ||
kubectl set image -n irisnet deployment/irisnet-docs frontend=irisnet/docs:${{ github.sha }} | ||
kubectl rollout status -n irisnet deployment/irisnet-docs |
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,30 @@ | ||
name: Build and Publish Docker Image | ||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5 | ||
|
||
jobs: | ||
setup-build-publish: | ||
name: Setup, Build and Publish | ||
runs-on: ubuntu-latest | ||
environment: production | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and Push Docker Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: irisnet/irishub:${{ github.ref == 'refs/tags/*' && github.ref || github.sha }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Release | ||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
|
||
jobs: | ||
setup-build-publish: | ||
name: Setup, Build and Publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Codes | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Golang | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '^1.21.0' # The Go version to download (if necessary) and use. | ||
|
||
- name: Build Binaries | ||
run: | | ||
sudo apt-get install -y gcc-aarch64-linux-gnu | ||
make build-all-binaries | ||
- name: Publish Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
body_path: RELEASE.md | ||
files: | | ||
build/iris-linux-amd64 | ||
build/iris-linux-arm64 |
11 changes: 5 additions & 6 deletions
11
.github/workflows/TestUnit.yml → .github/workflows/run-unit-tests.yml
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
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 @@ | ||
TODO |
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,12 +1,12 @@ | ||
FROM node:alpine AS builder | ||
WORKDIR /app | ||
COPY package.json yarn.lock ./ | ||
COPY docs/package.json docs/yarn.lock ./ | ||
RUN yarn install | ||
COPY . . | ||
COPY docs/ . | ||
RUN yarn run build | ||
|
||
FROM nginx:alpine | ||
RUN rm -rf /usr/share/nginx/html/* | ||
COPY --from=builder /app/.vuepress/dist /usr/share/nginx/html/docs | ||
EXPOSE 80 | ||
CMD ["nginx", "-g", "daemon off;"] | ||
CMD ["nginx", "-g", "daemon off;"] |
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.