-
Notifications
You must be signed in to change notification settings - Fork 2
75 lines (62 loc) · 2.19 KB
/
publish.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Build and Publish
on: [push]
jobs:
build:
name: Build and Publish to Server
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- name: Pull Project
uses: actions/checkout@v3.5.2
- name: cache deno installation and deno.land dependencies
uses: actions/cache@v3.3.1
with:
key: ${{ runner.os }}-deno-${{ hashFiles('**/*') }}
restore-keys: ${{ runner.os }}-deno-
path: |
/home/runner/.deno
/home/runner/.cache/deno/deps/*
- name: install or update deno installation
run: |
export DENO_INSTALL="/home/runner/.deno"
export PATH="${DENO_INSTALL}/bin:${PATH}"
mkdir -p "${DENO_INSTALL}"
deno upgrade || (
curl -fsSL https://deno.land/x/install/install.sh > "${DENO_INSTALL}/.sh";
sh "${DENO_INSTALL}/.sh"
)
echo "DENO_INSTALL=${DENO_INSTALL}" >> $GITHUB_ENV
echo "PATH=${PATH}" >> $GITHUB_ENV
deno upgrade
- name: fetch any uncached dependencies
run: |
deno cache --reload=file: ./main.ts
- name: Compile
run: deno compile -A --output bbn-bot main.ts
- name: Login to GitHub Container Registry
uses: docker/login-action@v2.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: "ghcr.io/bbn-holding/bbn-bot:latest"
- name: Set up Kubectl
run: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
- name: Configure Kubernetes credentials
env:
KUBECONFIG_DATA: ${{ secrets.KUBE_CREDENTIALS }}
run: |
echo "$KUBECONFIG_DATA" | base64 --decode > kubeconfig.yaml
- name: Restart Rollout
run: |
kubectl rollout restart deployment bbn-bot -n bbn-one --kubeconfig=kubeconfig.yaml