From 69e25b1e79b38cf852eeb4c5f6c821cebb9cebf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Lavorel?= Date: Tue, 31 Oct 2023 17:44:42 +0100 Subject: [PATCH] change ci --- .../{main.yml => deploy_production.yml} | 7 ++- .github/workflows/deploy_staging.yml | 44 +++++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) rename .github/workflows/{main.yml => deploy_production.yml} (97%) create mode 100644 .github/workflows/deploy_staging.yml diff --git a/.github/workflows/main.yml b/.github/workflows/deploy_production.yml similarity index 97% rename from .github/workflows/main.yml rename to .github/workflows/deploy_production.yml index 610b91c..3e7c077 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/deploy_production.yml @@ -1,5 +1,8 @@ -name: CI -on: push +name: Deploy production +on: + push: + branches: + - master jobs: deploy: runs-on: ubuntu-20.04 diff --git a/.github/workflows/deploy_staging.yml b/.github/workflows/deploy_staging.yml new file mode 100644 index 0000000..56756b0 --- /dev/null +++ b/.github/workflows/deploy_staging.yml @@ -0,0 +1,44 @@ +name: Deploy staging +on: + push: + branches: + - feat/next +jobs: + deploy: + runs-on: ubuntu-20.04 + steps: + - name: Git checkout + uses: actions/checkout@v4 + with: + ref: "feat/next" + + - name: Setup hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: "0.83.1" + extended: true + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: '15' + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + + - name: Build FR + run: | + npm ci + hugo --config config.toml --minify -b https://next.lumao.eu/ + cp .gitignore public + echo "next.lumao.eu" > public/CNAME + + - name: Pushes to another repository FR + uses: cpina/github-action-push-to-another-repository@main + env: + API_TOKEN_GITHUB: ${{ secrets.TOKEN }} + with: + source-directory: 'public' + destination-github-username: 'LavoWeb' + destination-repository-name: 'LumaoNext' + user-email: aurelien@lumao.eu + target-branch: master