Skip to content

Commit

Permalink
Merge pull request #197 from Kenny-NISLab/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
RyoichiNakai authored Feb 23, 2022
2 parents fc09c16 + 43f5ddc commit 85e27fc
Show file tree
Hide file tree
Showing 9 changed files with 2,587 additions and 21,328 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [12.x]
node: [15.x]

steps:
- name: Checkout 🛎
Expand Down
28 changes: 25 additions & 3 deletions .github/workflows/deploy_on_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node: [12.x]
node: [15.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -24,7 +24,7 @@ jobs:
with:
node-version: ${{ matrix.node }}
check-latest: true

- name: Create .env file
run: echo '${{ secrets.ENV_DEV }}' > .env

Expand Down Expand Up @@ -55,6 +55,29 @@ jobs:
channelId: live
projectId: lab-assignment-dev

deploy_to_functions:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2

- name: Install npm packages
run: |
cd functions
npm install
- name: Deploy to Cloud Functions
uses: w9jds/firebase-action@master
with:
args: deploy --only functions
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
PROJECT_ID: lab-assignment-dev

delete_preview_env:
runs-on: ubuntu-latest

Expand All @@ -76,4 +99,3 @@ jobs:

- name: Delete preview
run: firebase hosting:channel:delete ${{ github.event.number }} --token ${{ secrets.FIREBASE_TOKEN }} -f

2 changes: 1 addition & 1 deletion .github/workflows/deploy_on_dev_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node: [12.x]
node: [15.x]

steps:
- uses: actions/checkout@v2
Expand Down
23 changes: 22 additions & 1 deletion .github/workflows/deploy_on_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:

strategy:
matrix:
node: [12.x]
node: [15.x]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -55,4 +55,25 @@ jobs:
channelId: live
projectId: lab-assignment-prod

deploy_to_functions:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [14.x]

steps:
- uses: actions/checkout@v2

- name: Install npm packages
run: |
cd functions
npm install
- name: Deploy to Cloud Functions
uses: w9jds/firebase-action@master
with:
args: deploy --only functions
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
PROJECT_ID: lab-assignment-prod
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@

| パッケージ | バージョン |
| ---------- | ---------- |
| `yarn` | 1.22.10 |
| `node` | v12.22.7 |
| `yarn` | 1.22.17 |
| `node` | v15.14.0 |
| `firebase` | 9.6.1 |

> `firebase`に関しては,8 系と 9 系でコードの書き方が大きく異なるので,注意すること
Expand Down Expand Up @@ -108,14 +108,14 @@ nodebrew setup
nodebrew ls-remote

# Nodeのインストール
nodebrew install-binary v12.22.7
nodebrew compile v12.22.7 # M1の場合はこちら
nodebrew install-binary v15.14.0
nodebrew compile v15.14.0 # M1の場合はこちら

# インストールしたバージョンの確認
nodebrew ls

# 使いたいバージョンを指定
nodebrew use v12.22.7
nodebrew use v15.14.0

# nodeのバージョンを確認
node -v
Expand Down Expand Up @@ -152,7 +152,7 @@ npm install -g firebase-tools
#### 1. リポジトリのクローン

- `git`にて,リポジトリのクローンを行う
- GitHubにssh接続ができるように設定しておきましょう
- GitHub に ssh 接続ができるように設定しておきましょう

```bash
git clone git@github.com:Kenny-NISLab/lab-assignment.git
Expand Down Expand Up @@ -221,7 +221,7 @@ control + C

![image](https://user-images.githubusercontent.com/49640294/150631310-09a23a79-2f52-4403-aa20-65d58efbe601.png)

#### 4. VSCodeで開発に必要な拡張ツール
#### 4. VSCode で開発に必要な拡張ツール

開発するにあたり,以下の拡張ツールをインストールしておいてください

Expand Down Expand Up @@ -554,11 +554,13 @@ git push origin feature/#(チケット番号)

- ファイル名:`deploy_on_dev.yml`
- 開発環境へデプロイ
- 開発環境に Cloud Functions をデプロイ
- プレビュー環境の削除

- `main`ブランチに投げた PR をクローズした際(マージした際)
- ファイル名:`deploy_on_prod.yml`
- 本番環境へデプロイ
- 本番環境に Cloud Functions をデプロイ

---

Expand Down
3 changes: 0 additions & 3 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
"indexes": "firestore.index.json"
},
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
],
"source": "functions"
}
}
Loading

0 comments on commit 85e27fc

Please sign in to comment.