forked from EddieHubCommunity/BioDrop
-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (76 loc) · 2.42 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
75
76
77
78
79
name: Deploy
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
if: github.repository == 'EddieHubCommunity/LinkFree'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18"
cache: "npm"
- 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:
if: github.repository == 'EddieHubCommunity/LinkFree'
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@v3
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
- name: set up Docker builder
uses: docker/setup-buildx-action@v2
- name: log into GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: push to Github Container Registry
uses: docker/build-push-action@v3
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:
# if: github.repository == 'EddieHubCommunity/LinkFree'
# 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/[email protected]
# with:
# namespace: 'default'
# manifests: kubernetes/deployment.yaml
# images: 'ghcr.io/eddiehubcommunity/linkfree:v${{ steps.package-version.outputs.current-version}}'
# kubectl-version: 'latest'