This repository has been archived by the owner on Jun 25, 2024. It is now read-only.
forked from chralp/heyburrito
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (62 loc) · 2.18 KB
/
Continuous Delivery.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
70
71
72
73
74
75
76
77
name: Continuous Delivery
on:
pull_request:
branches:
- master
env:
PROJECT_ID: ${{ secrets.PROJECT_ID }}
GCP_INSTANCE: ${{ secrets.GCP_INSTANCE }}
GCP_INSTANCE_ZONE: ${{ secrets.GCP_INSTANCE_ZONE }}
jobs:
Continuous_Delivery:
runs-on: ubuntu-22.04
steps:
- name: Set up sources
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install dependencies
run: yarn
- name: Set up env
run: |
echo "BOT_NAME=${{ vars.BOT_NAME }}" > .env
echo "THEME=${{ vars.THEME }}" >> .env
echo "DATABASE_DRIVER=${{ vars.DATABASE_DRIVER }}" >> .env
echo "MONGODB_URL=${{ secrets.MONGODB_URL }}" >> .env
echo "MONGODB_DATABASE=${{ secrets.MONGODB_DATABASE }}" >> .env
echo "SLACK_API_TOKEN=${{ secrets.SLACK_API_TOKEN }}" >> .env
echo "SLACK_DAILY_CAP=${{ vars.SLACK_DAILY_CAP }}" >> .env
echo "SLACK_EMOJI_INC=${{ vars.SLACK_EMOJI_INC }}" >> .env
echo "SLACK_EMOJI_DEC=${{ vars.SLACK_EMOJI_DEC }}" >> .env
- name: Build docker image
run: yarn docker-build
- name: Login to docker-hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Push to docker-hub
run: yarn docker-push
- name: google auth
id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: set up Cloud SDK
uses: 'google-github-actions/setup-gcloud@v1'
with:
project_id: ${{ env.PROJECT_ID }}
- name: use gcloud cli
run: 'gcloud info'
- name: gcp deploy
run: |-
gcloud compute instances update-container "${{ env.GCP_INSTANCE }}" \
--zone "${{ env.GCP_INSTANCE_ZONE }}" \
--container-image "gdsc-konkuk/heygoose"
- name: gcp reset
run: |-
gcloud compute instances reset "${{ env.GCP_INSTANCE }}" \
--zone "${{ env.GCP_INSTANCE_ZONE }}"