From 022de03ecae54d0598ad03180947321abca7752d Mon Sep 17 00:00:00 2001 From: Julia March <101819212+juliamrch@users.noreply.github.com> Date: Wed, 29 Nov 2023 23:30:51 +0100 Subject: [PATCH] Create review apps CI/CD on pull requests * 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 --- .github/workflows/review-app.yml | 45 ++++++++++++++++++++++++++++++++ .github/workflows/test-cli.yml | 24 +++++++++++++++++ README.md | 1 - 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/review-app.yml create mode 100644 .github/workflows/test-cli.yml diff --git a/.github/workflows/review-app.yml b/.github/workflows/review-app.yml new file mode 100644 index 00000000..ce30086f --- /dev/null +++ b/.github/workflows/review-app.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/test-cli.yml b/.github/workflows/test-cli.yml new file mode 100644 index 00000000..5bbcca6d --- /dev/null +++ b/.github/workflows/test-cli.yml @@ -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 + diff --git a/README.md b/README.md index 7004b6bd..dd402893 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ This is a Hugo project with a theme called "Hextra" added a module..

- [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.