-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (42 loc) · 1.21 KB
/
okteto-preview-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
on:
pull_request:
types: [opened, reopened, closed]
name: Okteto Preview
jobs:
devflow:
environment: prod
runs-on: ubuntu-latest
steps:
- name: 'Install GitVersion'
uses: gittools/actions/gitversion/setup@v0.9.11
with:
versionSpec: '5.x'
- uses: jwalton/gh-find-current-pr@v1
id: findPr
with:
state: all
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- uses: okteto/context@latest
with:
token: ${{ secrets.OKTETO_TOKEN }}
- name: determine_version
uses: gittools/actions/gitversion/execute@v0.9.11
id: gitversion
with:
useConfigFile: true
configFilePath: 'GitVersion.yml'
- name: "Deploy the preview environment"
if: github.event.action == 'opened' || github.event.action == 'reopened'
uses: okteto/deploy-preview@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: rc-${{ steps.findPr.outputs.pr }}-gbauso
- name: "Destroy the preview environment"
if: github.event.action == 'closed'
uses: okteto/destroy-preview@latest
with:
name: rc-${{ steps.findPr.outputs.pr }}-gbauso