-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e00bc99
commit 026f91a
Showing
1 changed file
with
56 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,65 @@ | ||
name: Create Preview for PRs | ||
# name: Create Preview for PRs | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- closed | ||
branches: | ||
- master | ||
- v*.* | ||
# on: | ||
# pull_request: | ||
# types: | ||
# - opened | ||
# - reopened | ||
# - synchronize | ||
# - closed | ||
# branches: | ||
# - master | ||
# - v*.* | ||
|
||
env: | ||
PR_NUMBER: ${{ github.event.number }} | ||
# env: | ||
# PR_NUMBER: ${{ github.event.number }} | ||
|
||
jobs: | ||
comment-on-pr: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Comment on PR | ||
uses: hasura/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: ${{ github.repository }} | ||
number: ${{ github.event.number }} | ||
id: deploy-preview | ||
message: "Starting deployment of preview ⏳..." | ||
# jobs: | ||
# comment-on-pr: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Comment on PR | ||
# uses: hasura/[email protected] | ||
# with: | ||
# github-token: ${{ secrets.GITHUB_TOKEN }} | ||
# repository: ${{ github.repository }} | ||
# number: ${{ github.event.number }} | ||
# id: deploy-preview | ||
# message: "Starting deployment of preview ⏳..." | ||
|
||
create-preview: | ||
name: create preview | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout latest | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
# create-preview: | ||
# name: create preview | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: checkout latest | ||
# uses: actions/checkout@v4 | ||
# with: | ||
# fetch-depth: 0 | ||
|
||
- name: setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' | ||
cache: 'pip' # caching pip dependencies | ||
# - name: setup python | ||
# uses: actions/setup-python@v5 | ||
# with: | ||
# python-version: '3.9' | ||
# cache: 'pip' # caching pip dependencies | ||
|
||
- name: install dependencies | ||
run: | | ||
pip3 install -r requirements.txt | ||
# - name: install dependencies | ||
# run: | | ||
# pip3 install -r requirements.txt | ||
|
||
- name: Configure Git User | ||
run: | | ||
git config user.name "circleci-runai" | ||
git config user.email "[email protected]" | ||
# - name: Configure Git User | ||
# run: | | ||
# git config user.name "circleci-runai" | ||
# git config user.email "[email protected]" | ||
|
||
- name: building preview | ||
run: | | ||
mike deploy ${{ env.PR_NUMBER }} ${{ env.PR_NUMBER }}-alias -t ${{ env.PR_NUMBER }} --prop-set hidden=true --push | ||
# - name: building preview | ||
# run: | | ||
# mike deploy ${{ env.PR_NUMBER }} ${{ env.PR_NUMBER }}-alias -t ${{ env.PR_NUMBER }} --prop-set hidden=true --push | ||
|
||
- name: Update comment | ||
uses: hasura/[email protected] | ||
if: github.ref != 'refs/heads/main' | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
repository: ${{ github.repository }} | ||
number: ${{ github.event.number }} | ||
id: deploy-preview | ||
message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n ✨ https://docs.run.ai/${{ env.PR_NUMBER }} ✨\n\n🚀 Happy reviewing! 🚀" | ||
# - name: Update comment | ||
# uses: hasura/[email protected] | ||
# with: | ||
# github-token: ${{ secrets.GITHUB_TOKEN }} | ||
# repository: ${{ github.repository }} | ||
# number: ${{ github.event.number }} | ||
# id: deploy-preview | ||
# message: "A preview of ${{ github.event.after }} is uploaded and can be seen here:\n\n ✨ https://docs.run.ai/${{ env.PR_NUMBER }} ✨\n\n🚀 Happy reviewing! 🚀" |