|
1 | | -name: Production de la documentation |
2 | | - |
3 | | - |
4 | 1 | on: |
| 2 | + workflow_dispatch: |
5 | 3 | push: |
6 | | - branches: |
7 | | - - main |
8 | | - - master |
9 | | - - test |
| 4 | + branches: renv |
| 5 | + |
| 6 | +name: Quarto Publish |
10 | 7 |
|
11 | 8 | jobs: |
12 | | - docker: |
13 | | - if: "!contains(github.event.commits[0].message, '[skip ci]')" |
| 9 | + build-deploy: |
14 | 10 | runs-on: ubuntu-latest |
| 11 | + permissions: |
| 12 | + contents: write |
15 | 13 | steps: |
16 | | - - |
17 | | - name: Checkout |
18 | | - uses: actions/checkout@v2 |
19 | | - - |
20 | | - name: Set up QEMU |
21 | | - if: ${{ github.repository == 'inseefrlab/utilitr' }} |
22 | | - uses: docker/setup-qemu-action@v1 |
23 | | - - |
24 | | - name: Set up Docker Buildx |
25 | | - if: ${{ github.repository == 'inseefrlab/utilitr' }} |
26 | | - uses: docker/setup-buildx-action@v1 |
27 | | - - |
28 | | - name: Login to DockerHub |
29 | | - if: ${{ github.repository == 'inseefrlab/utilitr' }} |
30 | | - uses: docker/login-action@v1 |
31 | | - with: |
32 | | - username: ${{ secrets.DOCKERHUB_USERNAME }} |
33 | | - password: ${{ secrets.DOCKERHUB_TOKEN }} |
34 | | - - |
35 | | - name: Build and push |
36 | | - if: ${{ github.repository == 'inseefrlab/utilitr' }} |
37 | | - id: docker_build |
38 | | - uses: docker/build-push-action@v2 |
39 | | - env: |
40 | | - GITHUB_PAT: ${{ secrets.PAT }} |
41 | | - with: |
42 | | - push: true |
43 | | - context: . |
44 | | - tags: | |
45 | | - inseefrlab/utilitr:latest |
46 | | - inseefrlab/utilitr:0.9.1 |
47 | | - - |
48 | | - name: Image digest |
49 | | - run: echo ${{ steps.docker_build.outputs.digest }} |
50 | | - website: |
51 | | - name: Render website |
52 | | - if: "!contains(github.event.commits[0].message, '[skip ci]')" |
53 | | - needs: docker |
54 | | - runs-on: ubuntu-latest |
55 | | - container: inseefrlab/utilitr:latest |
56 | | - steps: |
57 | | - - uses: actions/checkout@v4 |
| 14 | + - name: Check out repository |
| 15 | + uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Install R |
| 18 | + uses: r-lib/actions/setup-r@v2 |
58 | 19 | with: |
59 | | - fetch-depth: 0 |
60 | | - ref: ${{ github.event.pull_request.head.ref }} |
61 | | - repository: ${{github.event.pull_request.head.repo.full_name}} |
| 20 | + r-version: '4.4.1' |
| 21 | + |
62 | 22 | - name: Install dependencies |
63 | 23 | run: | |
64 | | - git config --global --add safe.directory /__w/utilitR/utilitR |
65 | | - Rscript -e "install.packages(c('remotes'))" |
66 | | - Rscript -e "remotes::install_github('rstudio/htmltools')" |
67 | | - Rscript -e "remotes::install_github('r-spatial/sf', dependencies = TRUE)" |
68 | | - env: |
69 | | - GITHUB_PAT: ${{ secrets.PAT }} |
70 | | - - name: Render Book |
71 | | - run: | |
72 | | - ls |
73 | | - git remote -v |
74 | | - git config --global user.email quarto-github-actions-publish@example.com |
75 | | - git config --global user.name "Quarto GHA Workflow Runner" |
76 | | - quarto render --to html |
77 | | - quarto publish gh-pages --no-render --no-browser |
78 | | - - uses: actions/upload-artifact@v2 |
| 24 | + sudo ./docker/dependencies.sh |
| 25 | + rm -rf renv/ |
| 26 | + rm .Rprofile |
| 27 | + Rscript -e "install.packages('yaml')" |
| 28 | +
|
| 29 | + - name: Install renv packages |
| 30 | + uses: r-lib/actions/setup-renv@v2 |
79 | 31 | with: |
80 | | - name: _public |
81 | | - path: _public/ |
82 | | - retention-days: 5 |
| 32 | + cache-version: 2 |
| 33 | + |
| 34 | + - name: Set up Quarto environment |
| 35 | + uses: quarto-dev/quarto-actions/setup@v2 |
| 36 | + |
| 37 | + - name: Render and Publish |
| 38 | + uses: quarto-dev/quarto-actions/publish@v2 |
| 39 | + with: |
| 40 | + target: gh-pages |
| 41 | + env: |
| 42 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments