-
Notifications
You must be signed in to change notification settings - Fork 1
89 lines (77 loc) · 2.66 KB
/
deploy.yml
File metadata and controls
89 lines (77 loc) · 2.66 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
81
82
83
84
85
86
87
88
89
name: Deploy
on:
workflow_dispatch:
inputs:
cluster:
description: 'Cluster'
required: true
type: choice
options:
- ninja
- prod
version:
description: 'Tag'
# required: true
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: '22'
check-latest: true
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.x'
- name: Install Linode CLI
run: |
python -m pip install --upgrade pip
pip --version
pip install setuptools
pip install linode-cli --upgrade
- name: Install kubectl
run: |
curl -LO https://dl.k8s.io/release/v1.25.2/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
- name: Install yq
run: |
curl -fsSL -o yqq https://github.com/mikefarah/yq/releases/download/3.3.0/yq_linux_amd64
chmod +x yqq
sudo mv yqq /usr/local/bin/yqq
pipx install yq
- name: Install Hugo
run: |
curl -fsSL -o hugo_extended.deb https://github.com/gohugoio/hugo/releases/download/v0.111.1/hugo_extended_0.111.1_linux-amd64.deb
sudo dpkg -i hugo_extended.deb
- name: Install Hugo Tools
run: |
curl -fsSL -o hugo-tools https://github.com/appscodelabs/hugo-tools/releases/download/v0.2.23/hugo-tools-linux-amd64
chmod +x hugo-tools
sudo mv hugo-tools /usr/local/bin/hugo-tools
# - name: Setup upterm session
# uses: lhotari/action-upterm@v1
- name: Deploy
env:
REGISTRY: ghcr.io/appscode
CLUSTER: ${{ inputs.cluster }}
LINODE_CLI_TOKEN: ${{ secrets.LINODE_CLI_TOKEN }}
NINJA_KUBECONFIG: ${{ secrets.NINJA_KUBECONFIG }}
run: |
mkdir -p ~/.kube
echo "connect to $CLUSTER cluster"
if [ "$CLUSTER" = "prod" ]; then
linode-cli lke kubeconfig-view 326609 --json | jq -r .[0].kubeconfig | base64 -d > ~/.kube/config
else
echo ${NINJA_KUBECONFIG} > ~/.kube/config
fi
kubectl get nodes
echo "deploy docker image"
make deploy-to-linode TAG=${{ inputs.version }}