Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci support #1

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading