From 260783383d100aa63b0b923f84047c76f8f2011c Mon Sep 17 00:00:00 2001 From: Damien LUCAS Date: Sun, 23 Jun 2024 17:40:14 +0200 Subject: [PATCH] chore: modif github actions pour publish sous /slides sur les tags --- .github/workflows/deploy.yaml | 3 +- .github/workflows/tag.yaml | 53 +++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/tag.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index f6e43b9..0157d97 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -41,4 +41,5 @@ jobs: uses: JamesIves/github-pages-deploy-action@v4 with: folder: slides/build # The folder the action should deploy. - branch: gh-pages \ No newline at end of file + branch: gh-pages + clean: false \ No newline at end of file diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml new file mode 100644 index 0000000..2857ef4 --- /dev/null +++ b/.github/workflows/tag.yaml @@ -0,0 +1,53 @@ +name: Build and deploy tag release + +on: + push: + tags: + - '*' + +permissions: + contents: write + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + + - name: Checkout reveal.js 🛎️ + uses: actions/checkout@v3devoxx + with: + repository: hakimel/reveal.js + ref: 4.2.0 + path: reveal.js + + - name: Build reveal.js 🛎️ + run: npm ci && rm -rf node_modules\ + working-directory: reveal.js + + - name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built. + uses: addnab/docker-run-action@v3 + with: + image: asciidoctor/docker-asciidoctor:1.65 + options: -v ${{ github.workspace }}:/documents + run: | + asciidoctor-revealjs /documents/index.adoc + + - name: Copy build to folder 📦 + run: | + mkdir -p build/${{ github.ref_name }}/reveal.js/dist && \ + cp -r *.html images css fonts project build/${{ github.ref_name }} && \ + cp -r reveal.js/dist/* build/${{ github.ref_name }}/reveal.js/dist/ && \ + cp -r reveal.js/plugin build/${{ github.ref_name }}/reveal.js/ + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + folder: build + branch: gh-pages + clean: false \ No newline at end of file