-
-
Notifications
You must be signed in to change notification settings - Fork 8
58 lines (50 loc) · 1.72 KB
/
pr.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
name: Build and deploy (pull request)
on:
pull_request:
types: [synchronize, reopened, labeled]
env:
RELEASE_NAME: website-pr-${{ github.event.pull_request.number }}
CHART_VALUES_FILE: .helm/values.pr.yml
DEPLOY_NAMESPACE: doctors-pr
DEPLOY_ENV: pr-${{ github.event.pull_request.number }}
DEPLOY_URL: https://pr-${{ github.event.pull_request.number }}.zdravniki.sledilnik.org
IMAGE_TAG: pr-${{ github.event.pull_request.number }}
INGRESS_RULE: Host(`pr-${{ github.event.pull_request.number }}.zdravniki.sledilnik.org`)
jobs:
build:
if: contains(github.event.pull_request.labels.*.name, 'deploy-preview')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Build and push docker container image
uses: docker/build-push-action@v6
with:
push: true
context: .
file: ./Dockerfile
tags: |
ghcr.io/${{ github.repository_owner }}/website:${{ env.IMAGE_TAG}}
build-args: |
BUILD_MODE=staging
deploy:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'deploy-preview')
needs: build
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Deploy
uses: sledilnik/[email protected]
with:
chartName: sledilnik/website
chartVersion: '1.0.0'
kubeconfig: '${{ secrets.KUBECONFIG }}'