Skip to content

Commit

Permalink
Create review apps CI/CD on pull requests
Browse files Browse the repository at this point in the history
* fix broken links in quickstart

* fix pgpool path on card

* update readme: running instructions

* Update README.md

Update git clone commands and specify why initiating module might be required

* update readme: running instructions

* fix proxysql path on guides card

* update Readme with fixed name for github repo when cloning

* add test script files

* relocate workflow files

* modify test commands: remove outputs

* test review app script

* try review app without importing secrets

* add branch name as pull request source

* replace id steps by names

* fix yaml syntax

* set pull request to main

* fix errors in script

* fix script

* import connect secrets

* fix mess provoqued by yaml parser

* we will get there eventually

link just before deploying

* idem

* rm link step

* add bash

* divide bash steps

* divide setpes

* path checks

* path checks

* path checks without cloning

* path checks without cloning

* path checks with cloning

* path checks without cd

* use checkout action

* use checkout action on review apps

* remove branch on deploy command

* update to most recent commit to create propre PR

* add unshallow argument

* deactivate git command
  • Loading branch information
juliamrch authored Nov 29, 2023
1 parent 842bc42 commit 022de03
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/review-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Review app on pull request

on:
pull_request:
branches: main

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
CLEVER_SECRET: ${{ secrets.CLEVER_SECRET }}
CLEVER_TOKEN: ${{ secrets.CLEVER_TOKEN }}
#ORGA_ID: ${{ secrets.ORGA_ID }}
HUGO_VERSION: ${{ secrets.HUGO_VERSION }}

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0
#path: ${{ env.BRANCH_NAME }}
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
#- run: git fetch --unshallow
- name: install clever-tools
run: npm install -g clever-tools
- name: Create app
run: clever login --token ${{ env.CLEVER_TOKEN }} --secret ${{ env.CLEVER_SECRET }}
- run: clever create --type static-apache ${{ env.BRANCH_NAME }} --alias ${{ env.BRANCH_NAME }} --region par --org ${{secrets.ORGA_ID}}
- run: clever env set CC_PRE_BUILD_HOOK "./clevercloud-deploy-script.sh"
- run: clever env set CC_WEBROOT "/public"
- run: clever env set HUGO_ENV "production"
- run: clever env set HUGO_VERSION ${{env.HUGO_VERSION}}
- run: clever env set CC_PHP_VERSION "7"
- run: clever env set CC_CGI_IMPLEMENTATION "proxy_fcgi"
- run: clever env set CC_COMPOSER_VERSION "2"
- run: clever domain add clever-doc-preprod-${{ env.BRANCH_NAME }}.cleverapps.io
- name: Deploy
run: clever deploy
24 changes: 24 additions & 0 deletions .github/workflows/test-cli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test CLI

on:
push:
branches:
- ci-cd

jobs:
install:
runs-on: ubuntu-latest
steps:
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
- name: install celevr-tools
run: npm install -g clever-tools
- run: clever --version

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ This is a Hugo project with a theme called "Hextra" added a module..</p>
- [Reference Environnement Variables](https://developers.clever-cloud.com/doc/reference/reference-environment-variables/)
- [Guides and Tutorials](https://developers.clever-cloud.com/guides/)


## Features

- **Beautiful Design** - Inspired by Nextra, Hextra utilizes Tailwind CSS to offer a modern design that makes your site look outstanding.
Expand Down

0 comments on commit 022de03

Please sign in to comment.