-
Notifications
You must be signed in to change notification settings - Fork 0
147 lines (131 loc) · 5.14 KB
/
build-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
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
name: Build and deploy Docker image
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker (production)
id: meta-production
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=main
- name: Build and push Docker image (production)
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta-production.outputs.tags }}
labels: ${{ steps.meta-production.outputs.labels }}
build-args: |
NEXT_PUBLIC_BASE_URL=https://marketplace.sshopencloud.eu
NEXT_PUBLIC_SSHOC_API_BASE_URL=https://marketplace-api.sshopencloud.eu
NEXT_PUBLIC_MOCK_API=disabled
NEXT_PUBLIC_BOTS=enabled
NEXT_PUBLIC_MATOMO_BASE_URL=https://matomo.acdh.oeaw.ac.at/
NEXT_PUBLIC_MATOMO_APP_ID=179
NEXT_PUBLIC_GOOGLE_SITE_ID=nGy-4NymUoG2gvqsocWhF8A7TY9wVh5bAVIrPMNeC8M
NEXT_PUBLIC_LOCAL_CMS_BACKEND=disabled
NEXT_PUBLIC_GITHUB_REPOSITORY=sshoc/sshoc-marketplace-frontend
NEXT_PUBLIC_GITHUB_REPOSITORY_BRANCH=main
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy to cluster (production)
uses: acdh-oeaw/deploy-action@v1
with:
token: ${{ secrets.RANCHER_API_TOKEN }}
project: c-m-6hwgqq2g:p-jv25s
deployment: sshoc-marketplace-frontend:sshoc-mp-frontend
- name: Extract metadata (tags, labels) for Docker (stage)
id: meta-stage
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=stage
- name: Build and push Docker image (stage)
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta-stage.outputs.tags }}
labels: ${{ steps.meta-stage.outputs.labels }}
build-args: |
NEXT_PUBLIC_BASE_URL=https://sshoc-marketplace-stage.acdh-dev.oeaw.ac.at
NEXT_PUBLIC_SSHOC_API_BASE_URL=https://sshoc-marketplace-api-stage.acdh-dev.oeaw.ac.at
NEXT_PUBLIC_MOCK_API=disabled
NEXT_PUBLIC_BOTS=disabled
NEXT_PUBLIC_MATOMO_BASE_URL=https://matomo.acdh.oeaw.ac.at/
NEXT_PUBLIC_MATOMO_APP_ID=198
NEXT_PUBLIC_LOCAL_CMS_BACKEND=disabled
NEXT_PUBLIC_GITHUB_REPOSITORY=sshoc/sshoc-marketplace-frontend
NEXT_PUBLIC_GITHUB_REPOSITORY_BRANCH=main
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy to cluster (stage)
uses: acdh-oeaw/deploy-action@v1
with:
token: ${{ secrets.RANCHER_API_TOKEN }}
project: c-m-6hwgqq2g:p-jv25s
deployment: sshoc-marketplace-frontend:sshoc-mp-frontendstg
- name: Extract metadata (tags, labels) for Docker (dev)
id: meta-dev
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=dev
- name: Build and push Docker image (dev)
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta-dev.outputs.tags }}
labels: ${{ steps.meta-dev.outputs.labels }}
build-args: |
NEXT_PUBLIC_BASE_URL=https://sshoc-marketplace.acdh-dev.oeaw.ac.at
NEXT_PUBLIC_SSHOC_API_BASE_URL=https://sshoc-marketplace-api.acdh-dev.oeaw.ac.at
NEXT_PUBLIC_MOCK_API=disabled
NEXT_PUBLIC_BOTS=disabled
NEXT_PUBLIC_MATOMO_BASE_URL=https://matomo.acdh.oeaw.ac.at/
NEXT_PUBLIC_MATOMO_APP_ID=190
NEXT_PUBLIC_LOCAL_CMS_BACKEND=disabled
NEXT_PUBLIC_GITHUB_REPOSITORY=sshoc/sshoc-marketplace-frontend
NEXT_PUBLIC_GITHUB_REPOSITORY_BRANCH=main
secrets: |
"github_token=${{ secrets.GITHUB_TOKEN }}"
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Deploy to cluster (dev)
uses: acdh-oeaw/deploy-action@v1
with:
token: ${{ secrets.RANCHER_API_TOKEN }}
project: c-m-6hwgqq2g:p-jv25s
deployment: sshoc-marketplace-frontend:sshoc-mp-frontenddev