This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
92 lines (90 loc) · 3.72 KB
/
continuous_deployment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: 🚀 Continuous deployment
on:
push:
branches:
- main
workflow_dispatch:
inputs:
version:
type: choice
description: Version
required: true
options:
- patch
- minor
- major
env:
NODE_VERSION: 18
REGISTRY_URL: 'https://registry.npmjs.org'
GIT_USER_NAME: tokenstreet-tools
GIT_USER_EMAIL: [email protected]
jobs:
deploy_website:
name: 🌐 Deploy website
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: ${{ env.REGISTRY_URL }}
- name: 📥 Download deps
run: |
yarn install --frozen-lockfile
yarn install --cwd website --frozen-lockfile
yarn build
yarn install --cwd examples/bare --frozen-lockfile
yarn install --cwd examples/expo --frozen-lockfile
- run: yarn --cwd website build
# Popular action to deploy to GitHub Pages:
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./website/build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
# The GH actions bot is used by default if you didn't specify the two fields.
# You can swap them out with your own user credentials.
user_name: ${{ env.GIT_USER_NAME }}
user_email: ${{ env.GIT_USER_EMAIL }}
publish_package:
name: ⬆️ Publish package
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch'
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN_TOOLS_TOKENSTREET }}
- name: Set git credentials
run: |
git config --global user.name "${{ env.GIT_USER_NAME }}"
git config --global user.email "${{ env.GIT_USER_EMAIL }}"
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: ${{ env.REGISTRY_URL }}
- name: 📥 Download deps
run: |
yarn install --frozen-lockfile
yarn install --cwd website --frozen-lockfile
yarn build
yarn install --cwd examples/bare --frozen-lockfile
yarn install --cwd examples/expo --frozen-lockfile
- run: yarn version --${{ github.event.inputs.version }}
- run: git push --follow-tags
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}