-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (50 loc) · 1.48 KB
/
manual-deploy-to-development.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
# 指定のブランチを開発環境に手動デプロイするワークフロー
#
# TODO:
# - Reusable workflow を使用して cicd.yml と処理を共通化する
# @see https://docs.github.com/en/actions/using-workflows/reusing-workflows
name: Manual Deploy to Development
on:
workflow_dispatch:
inputs:
branch:
description: "Branch name"
required: true
default: develop
jobs:
Deploy:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
id-token: write
contents: read
env:
TARGET_ENV: dev
DEV_AWS_ACCOUNT_ID: ${{ vars.DEV_AWS_ACCOUNT_ID }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Cache Dependency
uses: actions/cache@v4
id: cache_dependency
env:
cache-name: cache-dependency
with:
path: "**/node_modules"
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }}
- name: Assume Role
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: "ap-northeast-1"
role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
- name: Deploy
run: |
npm run deploy:${{ env.TARGET_ENV }}
# TODO: E2E テスト実行処理の追加