-
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.
[fix]: update action.yml for all CICD
- Loading branch information
Showing
1 changed file
with
65 additions
and
65 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 |
---|---|---|
|
@@ -12,76 +12,76 @@ env: | |
GIT_TAG: ${{ github.sha }} | ||
|
||
jobs: | ||
# build-and-upload: | ||
# runs-on: ubuntu-latest | ||
# permissions: | ||
# contents: read | ||
# packages: write | ||
|
||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
|
||
# - name: Cache Node modules | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: ~/.npm | ||
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
# restore-keys: | | ||
# ${{ runner.os }}-yarn- | ||
|
||
# - name: Set up Node.js | ||
# uses: actions/setup-node@v2 | ||
# with: | ||
# node-version: '16' | ||
|
||
# - name: Install yarn dependencies | ||
# run: yarn install | ||
|
||
# - name: Build tsp-ui | ||
# run: yarn build | ||
|
||
# - name: Log in to the Container registry | ||
# uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
# with: | ||
# registry: ${{ env.REGISTRY }} | ||
# username: ${{ github.actor }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# - name: Extract metadata (tags, labels) for Docker | ||
# id: meta | ||
# uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
# with: | ||
# images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
# tags: ${{ env.GIT_TAG }} | ||
build-and-upload: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Cache Node modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Install yarn dependencies | ||
run: yarn install | ||
|
||
- name: Build tsp-ui | ||
run: yarn build | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: ${{ env.GIT_TAG }} | ||
|
||
# - name: Build and push Docker image | ||
# uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
# with: | ||
# context: . | ||
# push: true | ||
# tags: ${{ steps.meta.outputs.tags }} | ||
# labels: ${{ steps.meta.outputs.labels }} | ||
|
||
# - uses: convictional/[email protected] | ||
# with: | ||
# owner: WeiJiLab | ||
# repo: tsp-docker-compose-file | ||
# github_token: ${{ secrets.ZHU_TOKEN }} | ||
# workflow_file_name: action.yml | ||
# ref: master | ||
# wait_interval: 5 | ||
# inputs: '{"image_tag": "${{ env.GIT_TAG }}"}' | ||
# propagate_failure: true | ||
# trigger_workflow: true | ||
# wait_workflow: true | ||
|
||
connect-to-ec2: | ||
- name: Build and push Docker image | ||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- uses: convictional/[email protected] | ||
with: | ||
owner: WeiJiLab | ||
repo: tsp-docker-compose-file | ||
github_token: ${{ secrets.ZHU_TOKEN }} | ||
workflow_file_name: action.yml | ||
ref: master | ||
wait_interval: 5 | ||
inputs: '{"image_tag": "${{ env.GIT_TAG }}"}' | ||
propagate_failure: true | ||
trigger_workflow: true | ||
wait_workflow: true | ||
|
||
deploy-to-ec2: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: write | ||
# needs: build-and-upload | ||
needs: build-and-upload | ||
steps: | ||
|
||
- name: Checkout code | ||
|