-
Notifications
You must be signed in to change notification settings - Fork 4
80 lines (67 loc) · 1.95 KB
/
dev-deploy.yml
File metadata and controls
80 lines (67 loc) · 1.95 KB
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
on:
push:
branches:
- env/dev
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
GCP_KEY_PATH: "/tmp/key.json"
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Run actionlint
shell: bash
run: |
set -ex
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
./actionlint -color
- name: setup node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: nuxt setup
run: echo "${{ secrets.DEV_ENV }}" > .env
working-directory: ./web
- name: nuxt generate
run: |
yarn
yarn generate
working-directory: ./web
- name: copy files
run: |
rm -rf app/dist
cp -r web/dist app
working-directory: ./
- name: firebase setup
run: |
npm install -g firebase-tools
npm install
working-directory: ./app/functions
# deploy setup
- name: gcp_key file
run: |
set -ex
echo "${{ secrets.DEV_GCLOUD_SERVICE_KEY }}" | base64 -d > ${{ env.GCP_KEY_PATH }}
- uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.DEV_GCLOUD_SERVICE_KEY }}'
- name: 'Use gcloud CLI'
run: 'gcloud auth list --filter=status:ACTIVE --format="value(account)"'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
with:
install_components: ''
project_id: 'd-shrine-dev'
- name: firebase deploy
run: |
firebase deploy --project d-shrine-dev
working-directory: ./app