This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 134
65 lines (64 loc) · 2.07 KB
/
docker.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
name: Publish Docker image and deploy
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: npm install and build
run: |
npm ci
npm run build
- uses: actions/upload-artifact@main
with:
name: artifacts
path: prod/
push_to_registry:
name: Push Docker image to GitHub Packages
needs: build
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: version dockerfile
run: sed -i 's/v0.0.0/v${{ steps.package-version.outputs.current-version}}/g' Dockerfile
- 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
tags: |
ghcr.io/eddiehubcommunity/eddiebot:v${{ steps.package-version.outputs.current-version}}
ghcr.io/eddiehubcommunity/eddiebot: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/[email protected]
# with:
# namespace: 'default'
# manifests: kubernetes/deployment.yaml
# images: 'ghcr.io/eddiehubcommunity/eddiebot:v${{ steps.package-version.outputs.current-version}}'
# kubectl-version: 'latest'