forked from EddieHubCommunity/BioDrop
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (72 loc) · 2.22 KB
/
deploy.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
name: Build & publish Docker image then deploy
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: install dependencies
run: npm ci
- name: run build
run: npm run build
- uses: actions/upload-artifact@main
with:
name: artifacts
path: build/
push_to_registry:
name: Push Docker image to GitHub Packages
needs: build
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: check out the repo
uses: actions/checkout@v2
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: set up Docker builder
uses: docker/setup-buildx-action@v1
- name: log into GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: push to Github Container Registry
uses: docker/build-push-action@v2
with:
context: .
push: true
secrets: |
'GH_TOKEN=${{ secrets.GITHUB_TOKEN }}'
build-args: 'github_token=${{ secrets.GITHUB_TOKEN }}'
tags: |
ghcr.io/eddiehubcommunity/linkfree:v${{ steps.package-version.outputs.current-version}}
ghcr.io/eddiehubcommunity/linkfree:latest
deploy:
name: deploy to kube cluster
needs: push_to_registry
runs-on: ubuntu-latest
steps:
- name: check out the repo
uses: actions/checkout@v2
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- uses: Azure/k8s-set-context@v1
with:
kubeconfig: ${{ secrets.KUBE_CONFIG }}
- uses: Azure/k8s-deploy@v1.4
with:
namespace: 'default'
manifests: kubernetes/deployment.yaml
images: 'ghcr.io/eddiehubcommunity/linkfree:v${{ steps.package-version.outputs.current-version}}'
kubectl-version: 'latest'