Skip to content

Commit

Permalink
create a preview environment in demo.okteto.dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rberrelleza committed Apr 17, 2024
1 parent eb79481 commit 736811b
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/previews-closed.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# file: .github/workflows/preview-closed.yaml
on:
pull_request:
types:
- closed

jobs:
closed:
runs-on: ubuntu-latest
steps:
- name: Context
uses: okteto/context@latest
with:
url: ${{secrets.OKTETO_DEMO_URL}}
token: ${{ secrets.OKTETO_DEMO_TOKEN }}

- name: Destroy preview environment
uses: okteto/destroy-preview@latest
with:
name: pr-${{ github.event.number }}
24 changes: 24 additions & 0 deletions .github/workflows/previews.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on:
pull_request:
branches:
- main

jobs:
preview:
runs-on: ubuntu-latest
steps:
- name: Context
uses: okteto/context@latest
with:
url: ${{secrets.OKTETO_DEMO_URL}}
token: ${{ secrets.OKTETO_DEMO_TOKEN }}

- name: Deploy preview environment
uses: okteto/deploy-preview@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: pr-${{ github.event.number }}
timeout: 15m


9 changes: 8 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ services:
build:
context: .
ports:
- "8080:8080"
- "8080:8080"
endpoints:
labels:
dev.okteto.com/endpoints: https://docs-${OKTETO_NAMESPACE}.${OKTETO_DEMO_URL}/docs
rules:
- path: /
service: docs
port: 8080

0 comments on commit 736811b

Please sign in to comment.