-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (58 loc) · 1.87 KB
/
discord-bot.yaml
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
name: Deploy ROvACC Discord Bot to Google Cloud Run
on:
push:
branches:
- master
paths:
- 'packages/discord-bot/**'
pull_request:
branches:
- master
paths:
- 'packages/discord-bot/**'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install dependencies
run: npm ci
- name: Build project
run: |
npx nx build discord-bot --prod
npx nx deploy discord-bot --prod
env:
PROJECT_ID: ${{ secrets.GOOGLE_CLOUD_PROJECT_ID }}
# - name: Deploy to Google Cloud Run
#
# uses: GoogleCloudPlatform/github-actions/setup-gcloud@main
# with:
# service_account_email: ${{ secrets.GOOGLE_CLOUD_RUN_SERVICE_ACCOUNT_EMAIL }}
# service_account_key: ${{ secrets.GOOGLE_CLOUD_RUN_SERVICE_ACCOUNT_KEY }}
# project_id: ${{ secrets.GOOGLE_CLOUD_PROJECT_ID }}
# - name: Deploying to Cloud Run
# env:
# PROJECT_ID: ${{ secrets.GOOGLE_CLOUD_PROJECT_ID }}
# run: |
# gcloud config set project $PROJECT_ID
# gcloud beta run deploy myapp --image gcr.io/$PROJECT_ID/discord-bot --platform managed --allow-unauthenticated
auth-in-gcp:
runs-on: ubuntu-22.04
steps:
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}'
- name: Set up Cloud SDK
uses: 'google-github-actions/setup-gcloud@v1'
with:
project_id: ${{ secrets.GOOGLE_CLOUD_PROJECT_ID }}
- name: Use gcloud CLI
run: 'gcloud info'
- name: Auth in Google Cloud Artifact
run: 'gcloud auth configure-docker europe-docker.pkg.dev'