Skip to content

Commit

Permalink
ci support
Browse files Browse the repository at this point in the history
  • Loading branch information
fewensa committed Sep 30, 2024
1 parent 2008893 commit 9e065cb
Show file tree
Hide file tree
Showing 32 changed files with 4,228 additions and 1,334 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy develop

on:
pull_request:
workflow_dispatch:

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy to Vercel
with:
node_version: 20
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
workdir: packages/web
dist_path: out
preview_output: true
project_name: migration-helper
enable_cache: true
enable_notify_comment: true

28 changes: 28 additions & 0 deletions .github/workflows/deploy-prd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy production

on:
push:
tags:
- 'v*'

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy to Vercel
with:
node_version: 20
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
workdir: packages/web
dist_path: out
preview_output: true
project_name: migration-helper
prod_mode: true
enable_cache: true
enable_notify_comment: true

26 changes: 26 additions & 0 deletions .github/workflows/deploy-stg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy staging

on:
push:
branches: [main]

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: darwinia-network/devops/actions/smart-vercel@main
name: Deploy to Vercel
with:
node_version: 20
vercel_token: ${{ secrets.VERCEL_TOKEN }}
vercel_group: itering
workdir: packages/web
dist_path: out
preview_output: true
project_name: migration-helper
enable_cache: true
enable_notify_comment: true

48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Release

on:
push:
tags:
- "v*"
workflow_dispatch:

env:
DOCKER_REGISTRY: ghcr.io

jobs:
publish-docker-image:
name: Publish docker image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Docker login
uses: docker/login-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.DOCKER_REGISTRY }}

- name: Tag
uses: olegtarasov/[email protected]
- name: Sha
uses: benjlevesque/[email protected]

- name: Publish docker image
uses: docker/build-push-action@v3
with:
push: true
context: packages/delegator
file: Dockerfile
tags: |
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/delegator:sha-${{ env.SHA }}
- name: Publish docker image with tag
uses: docker/build-push-action@v3
if: startsWith(github.ref, 'refs/tags/v')
with:
push: true
context: packages/delegator
file: Dockerfile
tags: |
${{ env.DOCKER_REGISTRY }}/${{ github.repository }}/delegator:${{ env.GIT_TAG_NAME }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ node_modules

# Test data
tmp

out
build
dist
tsconfig.tsbuildinfo
Loading

0 comments on commit 9e065cb

Please sign in to comment.