diff --git a/.github/workflows/previews-closed.yaml b/.github/workflows/previews-closed.yaml new file mode 100644 index 000000000..4e335b55e --- /dev/null +++ b/.github/workflows/previews-closed.yaml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/previews.yaml b/.github/workflows/previews.yaml new file mode 100644 index 000000000..a00a2f2f1 --- /dev/null +++ b/.github/workflows/previews.yaml @@ -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 + + \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 72eca69c0..cc19b0213 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,4 +3,11 @@ services: build: context: . ports: - - "8080:8080" \ No newline at end of file + - "8080:8080" +endpoints: + labels: + dev.okteto.com/endpoints: https://docs-${OKTETO_NAMESPACE}.${OKTETO_DEMO_URL}/docs + rules: + - path: / + service: docs + port: 8080 \ No newline at end of file