-
Notifications
You must be signed in to change notification settings - Fork 1.1k
150 lines (142 loc) · 4.75 KB
/
release-docs.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
---
name: Release Docs
on: push
jobs:
publish-dev:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Docs
uses: actions/checkout@v3
- name: Login ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
# when push to master
- name: Build Dev Container
uses: docker/build-push-action@v3
with:
push: true
file: Dockerfile.dev
tags: |
ghcr.io/${{ github.repository }}:dev
context: .
build-args: |
RANCHER_DOCS_PACKAGE=ghcr.io/${{ github.repository }}
publish-build:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Docs
uses: actions/checkout@v3
- name: Login ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
# when push to staging
- name: Build Staging
uses: docker/build-push-action@v3
with:
push: true
file: Dockerfile.build
context: .
tags: |
ghcr.io/${{ github.repository }}:build
build-args: |
RANCHER_DOCS_PACKAGE=ghcr.io/${{ github.repository }}
publish-staging:
if: ${{ github.ref == 'refs/heads/staging' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Docs
uses: actions/checkout@v3
- name: Login ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
# when push to staging
- name: Build Staging
uses: docker/build-push-action@v3
with:
push: true
file: Dockerfile.staging
context: .
tags: |
ghcr.io/${{ github.repository }}:staging
build-args: |
RANCHER_DOCS_PACKAGE=ghcr.io/${{ github.repository }}
publish-latest:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Docs
uses: actions/checkout@v3
- name: Login ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
# when push to master
- name: Build and Publish Latest
uses: docker/build-push-action@v3
with:
push: true
file: Dockerfile.prod
context: .
tags: |
ghcr.io/${{ github.repository }}:latest
build-args: |
RANCHER_DOCS_PACKAGE=ghcr.io/${{ github.repository }}
publish-algolia:
if: ${{ github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
needs:
- publish-latest
steps:
- name: Checkout Docs
uses: actions/checkout@v3
- name: Login ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
# when push to master
- name: Build and Publish algolia
uses: docker/build-push-action@v3
with:
push: true
file: Dockerfile.algolia
context: .
tags: |
ghcr.io/${{ github.repository }}:algolia
build-args: |
RANCHER_DOCS_PACKAGE=ghcr.io/${{ github.repository }}
test-prod:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
steps:
- name: Checkout Docs
uses: actions/checkout@v3
- name: Login ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
- name: Test Build
uses: docker/build-push-action@v3
with:
file: Dockerfile.prod
context: .
tags: |
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
build-args: |
RANCHER_DOCS_PACKAGE=ghcr.io/${{ github.repository }}