-
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.
Merge pull request #387 from carbon-bond/add_production_workflow
新增 production 所需 workflow
- Loading branch information
Showing
5 changed files
with
98 additions
and
14 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: api-service-build-production | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./api-service | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- uses: Swatinem/rust-cache@v1 | ||
with: | ||
working-directory: ./api-service | ||
- name: 編譯 | ||
run: sh ./build.sh | ||
- name: 登入 DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: 建構並推送 docker 映像檔 | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./api-service | ||
push: true | ||
tags: carbonbond/api-service:stable | ||
file: ./api-service/deploy/Dockerfile | ||
- name: 佈屬到正式環境 | ||
if: ${{ success() }} | ||
uses: distributhor/workflow-webhook@v2 | ||
env: | ||
webhook_url: ${{ secrets.PRODUCTION_WEBHOOK_URL }}/hooks/redeploy-api-service | ||
webhook_secret: ${{ secrets.PRODUCTION_WEBHOOK_SECRET }} | ||
verify_ssl: false | ||
verbose: true |
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,44 @@ | ||
name: frontend-build-production | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
working-directory: ./frontend | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '14.x' | ||
- uses: c-hive/gha-yarn-cache@v2 | ||
with: | ||
directory: ./frontend | ||
- run: yarn install | ||
- run: yarn build | ||
- name: 登入 DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: 建構並推送 docker 映像檔 | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: ./frontend | ||
push: true | ||
tags: carbonbond/frontend:stable | ||
file: ./frontend/deploy/Dockerfile | ||
- name: 佈屬到正式環境 | ||
if: ${{ success() }} | ||
uses: distributhor/workflow-webhook@v2 | ||
env: | ||
webhook_url: ${{ secrets.PRODUCTION_WEBHOOK_URL }}/hooks/redeploy-frontend | ||
webhook_secret: ${{ secrets.PRODUCTION_WEBHOOK_SECRET }} | ||
verify_ssl: false | ||
verbose: true |
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