Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

docs: update preview #2

docs: update preview

docs: update preview #2

Workflow file for this run

name: notice
on:
push:
branches: [main]
paths:
- '.github/workflows/notice.yml'
- 'api/**'
- 'lib/**'
- 'index.js'
# pull_request:
# branches: [main]
jobs:
# notice-ui:
# runs-on: ${{ matrix.os }}
# env:
# # IMAGE_OWNER: dvgamerr
# # IMAGE_NAME: line-liff
# # PLATFORMS: linux/amd64,linux/arm64/v8
# # IMAGE_FILE: notice-ui.Dockerfile
# # KUBE_DEPLOY: deploy/line-liff
# # KUBE_CONTAINER: line-liff
# # KUBE_NAMESPACE: notice-line
# # BASE_URL: https://notice.touno.io
# steps:
# - name: Checkout πŸ›Ž
# uses: actions/checkout@master
# - name: Install Node.js
# uses: actions/setup-node@v4
# with:
# node-version: 16
# - name: Get yarn cache directory path πŸ› 
# id: yarn-cache-dir-path
# run: echo "::set-output name=dir::$(yarn cache dir)"
# - name: Cache node_modules πŸ“¦
# uses: actions/cache@v3.3.1
# id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
# with:
# path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
# key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-yarn-
# - name: Install dependencies πŸ‘¨πŸ»β€πŸ’»
# run: pnpm i --prod
# # - name: Run linter πŸ‘€
# # run: yarn lint
# - name: Run Build βš™οΈ
# run: yarn build
# - name: Prepare πŸ”°
# id: prepare
# run: |
# echo ::set-output name=kube_deploy::${KUBE_DEPLOY}
# echo ::set-output name=kube_container::${KUBE_CONTAINER}
# echo ::set-output name=kube_namespace::${KUBE_NAMESPACE}
# VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# # Strip "v" prefix from tag name
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=v$(echo $VERSION | sed -e 's/^v//')
# # Use Docker `latest` tag convention
# [ "$VERSION" == "main" ] && VERSION=latest
# # Use Docker `test` tag convention
# [ "${{github.event_name}}" == "pull_request" ] && VERSION=test
# echo ::set-output name=docker_image::$IMAGE_OWNER/$IMAGE_NAME
# echo ::set-output name=version::${VERSION}
# echo ::set-output name=buildx_args::--platform $PLATFORMS \
# --build-arg VERSION=${VERSION} \
# --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
# --build-arg VERSION=$VERSION \
# --tag $IMAGE_OWNER/$IMAGE_NAME:$VERSION --file $IMAGE_FILE .
# - name: Set up Docker Buildx πŸ“
# uses: docker/setup-buildx-action@v2
# - name: Docker Buildx βš™οΈ
# run: docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
# - name: Notify After Build Fail πŸ””
# if: failure() && github.event_name != 'pull_request'
# run: curl -X PUT https://notice.touno.io/system/notice/%E2%9D%8C%20*%5BFailure%5D*%20Steps:%20Docker%20Buildx%20%E2%9A%99%EF%B8%8F
# - name: Login to DockerHub
# if: success() && github.event_name != 'pull_request'
# uses: docker/login-action@v3
# with:
# username: ${{ github.actor }}
# password: ${{ secrets.DOCKER_TOKEN }}
# - name: Docker Push πŸ“Œ
# if: success() && github.event_name != 'pull_request'
# run: docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
# - name: Inspect πŸ”
# if: success() && github.event_name != 'pull_request'
# run: docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
# # - name: Trigger deploy πŸš€
# # if: success() && github.event_name != 'pull_request'
# # uses: Consensys/kubernetes-action@1.1.0
# # env:
# # KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
# # with:
# # args: set image ${{ steps.prepare.outputs.kube_deploy }} ${{ steps.prepare.outputs.kube_container }}=${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }} -n ${{ steps.prepare.outputs.kube_namespace }}
# - name: Restart deployment πŸš€
# if: success() && github.event_name != 'pull_request'
# uses: Consensys/kubernetes-action@1.1.0
# env:
# KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
# with:
# args: rollout restart ${{ steps.prepare.outputs.kube_deploy }} -n ${{ steps.prepare.outputs.kube_namespace }}
# - name: Status deployment πŸ”
# if: success() && github.event_name != 'pull_request'
# uses: Consensys/kubernetes-action@1.1.0
# env:
# KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
# with:
# args: rollout status ${{ steps.prepare.outputs.kube_deploy }} -n ${{ steps.prepare.outputs.kube_namespace }}
notice:
runs-on: ubuntu-20.04
env:
IMAGE_OWNER: dvgamerr
IMAGE_FILE: Dockerfile
IMAGE_NAME: notice
PLATFORMS: linux/amd64,linux/arm64
outputs:
container_name: ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
version: ${{ steps.prepare.outputs.version }}
steps:
- name: Checkout πŸ›Ž
uses: actions/checkout@v4
- name: Prepare πŸ”°
id: prepare
run: |
echo "kube_container=${KUBE_CONTAINER}" >> $GITHUB_OUTPUT
echo "kube_namespace=${KUBE_NAMESPACE}" >> $GITHUB_OUTPUT
echo "docker_image=${{github.actor}}/$IMAGE_NAME" >> $GITHUB_OUTPUT
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# # Strip "v" prefix from tag name
# [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=v$(echo $VERSION | sed -e 's/^v//')
# # Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "buildx_args=--platform $PLATFORMS \
--build-arg VERSION=${VERSION} \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg VERSION=$VERSION \
--tag ${{github.actor}}/$IMAGE_NAME:$VERSION --file $IMAGE_FILE ." >> $GITHUB_OUTPUT
- name: Set up Docker Buildx πŸ“
uses: docker/setup-buildx-action@v3
- name: Docker Buildx βš™οΈ
run: docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
# - name: Notify After Build Fail πŸ””
# if: failure() && github.event_name != 'pull_request'
# run: curl -X PUT https://notice.touno.io/system/notice/%E2%9D%8C%20*%5BFailure%5D*%20Steps:%20Docker%20Buildx%20%E2%9A%99%EF%B8%8F
- name: Login to DockerHub
if: success() && github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Docker Push πŸ“Œ
run: docker buildx build --output "type=image,push=${{ github.event_name != 'pull_request' }}" ${{ steps.prepare.outputs.buildx_args }}
# - name: Trigger deploy πŸš€
# if: success() && github.event_name != 'pull_request'
# uses: Consensys/kubernetes-action@1.1.0
# env:
# KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
# with:
# args: set image ${{ steps.prepare.outputs.kube_deploy }} ${{ steps.prepare.outputs.kube_container }}=${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }} -n ${{ steps.prepare.outputs.kube_namespace }}
# - name: Restart deployment πŸš€
# if: success() && github.event_name != 'pull_request'
# uses: Consensys/kubernetes-action@1.1.0
# env:
# KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
# with:
# args: rollout restart ${{ steps.prepare.outputs.kube_deploy }} -n ${{ steps.prepare.outputs.kube_namespace }}
# - name: Status deployment πŸ”
# if: success() && github.event_name != 'pull_request'
# uses: Consensys/kubernetes-action@1.1.0
# env:
# KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
# with:
# args: rollout status ${{ steps.prepare.outputs.kube_deploy }} -n ${{ steps.prepare.outputs.kube_namespace }}
# notify-api:
# runs-on: ubuntu-20.04
# needs: notice
# if: failure() && github.event_name != 'pull_request'
# steps:
# - name: Notify πŸ””
# run: curl -X PUT https://notice.touno.io/system/notice/%E2%9D%8C%20*%5BFailure%5D*%20Job:%20${{ github.job }}%20%E2%9A%99%EF%B8%8F
# notify-ui:
# runs-on: ubuntu-20.04
# needs: notice-ui
# if: failure() && github.event_name != 'pull_request'
# steps:
# - name: Notify πŸ””
# run: curl -X PUT https://notice.touno.io/system/notice/%E2%9D%8C%20*%5BFailure%5D*%20Job:%20${{ github.job }}%20%E2%9A%99%EF%B8%8F