-
Notifications
You must be signed in to change notification settings - Fork 5
47 lines (43 loc) · 1.98 KB
/
main.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
# This is a basic workflow to help you get started with Actions
name: Build & Deploy
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [main]
release:
types: [published]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build-and-deploy:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4
# - uses: rlespinasse/[email protected]
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: install dependencies
run: |
curl -Lo skaffold https://storage.googleapis.com/skaffold/releases/latest/skaffold-linux-amd64
chmod +x skaffold
sudo mv skaffold /usr/local/bin
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
- name: create kubeconfig
run: |
mkdir ${HOME}/.kube
cp k8s/config.yaml ${HOME}/.kube/config
cd ${HOME}/.kube
sed -i 's;$KUBE_CLUSTER_SERVER;${{ secrets.KUBE_CLUSTER_SERVER }};g' config
sed -i 's;$KUBE_CLUSTER_CERTIFICATE;${{ secrets.KUBE_CLUSTER_CERTIFICATE }};g' config
sed -i 's;$KUBE_CERTIFICATE_DATA;${{ secrets.KUBE_CERTIFICATE_DATA }};g' config
sed -i 's;$KUBE_KEY_DATA;${{ secrets.KUBE_KEY_DATA }};g' config
- name: build-and-deploy
env:
VITE_MAPBOX_ACCESS_TOKEN: ${{ secrets.VITE_MAPBOX_ACCESS_TOKEN }}
TRAFIKLAB_KEY: ${{ secrets.TRAFIKLAB_KEY }}
run: |
skaffold run --default-repo registry.iteam.services