This repository has been archived by the owner on Sep 8, 2023. It is now read-only.
Merge pull request #1011 from onflow/nialexsan-patch-1 #1986
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
name: 🚀 Deploy | |
on: | |
push: | |
branches: | |
- main | |
- production | |
pull_request: {} | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
permissions: | |
actions: write | |
contents: read | |
jobs: | |
prettier: | |
name: Prettier | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: "yarn" | |
- name: Install modules | |
run: yarn install | |
- name: Formatting | |
run: yarn format:check:app | |
- uses: ravsamhq/notify-slack-action@v2 | |
if: always() | |
with: | |
status: ${{ job.status }} | |
notification_title: "Developer Portal Build Failiure" | |
message_format: "{emoji} *{workflow}* {job} {status_message}" | |
footer: "<{run_url}|View Run>" | |
notify_when: "failure" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ENDPOINT }} | |
lint: | |
name: ESLint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: "yarn" | |
- name: Install modules | |
run: yarn install | |
- name: Eslint | |
run: yarn lint | |
- uses: ravsamhq/notify-slack-action@v2 | |
if: always() | |
with: | |
status: ${{ job.status }} | |
notification_title: "Developer Portal Build Failiure" | |
message_format: "{emoji} *{workflow}* {job} {status_message}" | |
footer: "<{run_url}|View Run>" | |
notify_when: "failure" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ENDPOINT }} | |
vitest: | |
name: Vitest | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: "yarn" | |
- name: Install modules | |
run: yarn install | |
- run: yarn test | |
- uses: ravsamhq/notify-slack-action@v2 | |
if: always() | |
with: | |
status: ${{ job.status }} | |
notification_title: "Developer Portal Build Failiure" | |
message_format: "{emoji} *{workflow}* {job} {status_message}" | |
footer: "<{run_url}|View Run>" | |
notify_when: "failure" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ENDPOINT }} | |
typecheck: | |
name: TypeScript | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: "yarn" | |
- name: Install modules | |
run: yarn install | |
- name: Generate js from svg | |
run: yarn build:0-svg | |
- name: Typescript | |
run: yarn typecheck | |
- uses: ravsamhq/notify-slack-action@v2 | |
if: always() | |
with: | |
status: ${{ job.status }} | |
notification_title: "Developer Portal Build Failiure" | |
message_format: "{emoji} *{workflow}* {job} {status_message}" | |
footer: "<{run_url}|View Run>" | |
notify_when: "failure" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ENDPOINT }} | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
cache: "yarn" | |
- name: Install modules | |
run: yarn install | |
- name: Build | |
run: yarn build | |
- uses: ravsamhq/notify-slack-action@v2 | |
if: always() | |
with: | |
status: ${{ job.status }} | |
notification_title: "Developer Portal Build Failiure" | |
message_format: "{emoji} *{workflow}* {job} {status_message}" | |
footer: "<{run_url}|View Run>" | |
notify_when: "failure" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ENDPOINT }} | |
deploy: | |
name: Deploy Staging | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
needs: [lint, typecheck, build] | |
# only build/deploy main branch on pushes | |
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: flyctl deploy --config fly.staging.toml -e GIT_SHA=$(git rev-parse HEAD) | |
- uses: ravsamhq/notify-slack-action@v2 | |
if: always() | |
with: | |
status: ${{ job.status }} | |
notification_title: "Deploying `${{ github.ref_name }}` to Staging" | |
message_format: "{emoji} *{workflow}* to staging {status_message}" | |
footer: "<{run_url}|View Run> | <https://flow-docs-staging.fly.dev>" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ENDPOINT }} | |
deploy-production: | |
name: Deploy Production | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
needs: [lint, typecheck, build] | |
# only build/deploy main branch on pushes | |
if: ${{ github.ref == 'refs/heads/production' && github.event_name == 'push' }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: flyctl deploy --config fly.production.toml -e GIT_SHA=$(git rev-parse HEAD) | |
- uses: ravsamhq/notify-slack-action@v2 | |
if: always() | |
with: | |
status: ${{ job.status }} | |
notification_title: "Deploying `${{ github.ref_name }}` to Production" | |
message_format: "{emoji} *{workflow}* to production {status_message}" | |
footer: "<{run_url}|View Run> | <https://developers.flow.com>" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_ENDPOINT }} | |