-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (76 loc) · 2.76 KB
/
deploy.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: "Deploy Colormatic!"
on:
push:
branches:
- main
jobs:
# Fairly standard build and push.
build-and-push-docker:
name: Build and push Docker image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
build-args: |
GITHUB_ACTIONS_RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
tags: |
ghcr.io/${{ github.repository }}/colormatic:latest
ghcr.io/${{ github.repository }}/colormatic:${{ github.sha }}
deploy-to-kubernetes:
name: Deploy Kubernetes manifests using Teleport and Kubectl
runs-on: ubuntu-latest
needs: build-and-push-docker
permissions:
id-token: write
contents: read
# As our join token specifies `environment: production`, the job
# also requires this.
environment: production
steps:
- uses: actions/checkout@v3
- name: Install Kubectl
uses: azure/setup-kubectl@v3
- name: Install Teleport
uses: teleport-actions/setup@v1
with:
version: 13.4.3
- name: Authenticate with Teleport
# https://github.com/teleport-actions/auth-k8s
uses: teleport-actions/auth-k8s@v1
with:
# Specify the publically accessible address of your Teleport proxy.
proxy: noah-demo.teleport.sh:443
# Specify the name of the join token for your bot.
token: colormatic-deployer
# Specify the length of time that the generated credentials should be
# valid for. This is optional and defaults to "1h".
# Here we've limited it to 10m as this CI job doesn't need longer.
certificate-ttl: 10m
# Specify the name of the Kubernetes cluster the credentials will be
# generated for.
kubernetes-cluster: gcp
# Enable submission of anonymous usage telemetry to Teleport.
# See https://goteleport.com/docs/machine-id/reference/telemetry/ for
# more information.
anonymous-telemetry: 1
- uses: azure/k8s-deploy@v4
with:
namespace: 'colormatic'
annotate-namespace: false
manifests: |
kubernetes/99-deployment.yaml
kubernetes/99-service.yaml
images: 'ghcr.io/strideynet/machineid-github-kubernetes-webinar/colormatic:${{ github.sha }}'