Skip to content

Commit

Permalink
[fix]: update action.yml for all CICD
Browse files Browse the repository at this point in the history
  • Loading branch information
mackizhu committed Aug 21, 2023
1 parent 45681be commit b56a51c
Showing 1 changed file with 65 additions and 65 deletions.
130 changes: 65 additions & 65 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b56a51c

Please sign in to comment.