-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.qmd
109 lines (89 loc) · 2.81 KB
/
README.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
---
title: Netlify Deploy Site
format: gfm
---
```{r}
#| include: false
library(tidyverse)
action <- yaml::read_yaml("action.yml")
```
`r action$description`
## Usage
```yaml
- name: Deploy to Netlify 🚀
uses: data-intuitive/netlify-deploy-site@v1
with:
auth: ${{ secrets.NETLIFY_AUTH_TOKEN }}
site: 'my-netlify-site'
dir: '_site'
prod: true
message: 'Deploy production ${{ github.ref }}'
```
## Inputs
```{r}
#| echo: false
lines <- map_chr(names(action$inputs), function(name) {
input <- action$inputs[[name]]
required <- ifelse (input$required %||% FALSE, "required", "optional")
glue::glue("* `{name}` (_{required}_): {input$description}")
})
knitr::asis_output(paste0(lines, collapse = "\n"))
```
## Outputs
```{r}
#| echo: false
lines <- map_chr(names(action$outputs), function(name) {
output <- action$outputs[[name]]
glue::glue("* `{name}`: {output$description}")
})
knitr::asis_output(paste0(lines, collapse = "\n"))
```
## Example with Quarto
This example action will run `quarto render` on a project and then publish the site on Netlify. Remove the part about Quarto if not relevant or using a different builder.
```yaml
on:
push:
branches: [ main, master ]
pull_request:
name: Render project
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Render Quarto Project
uses: quarto-dev/quarto-actions/render@v2
- name: Deploy to Netlify 🚀
if: github.event_name != 'pull_request'
uses: data-intuitive/netlify-deploy-site@v1
with:
auth: ${{ secrets.NETLIFY_AUTH_TOKEN }}
dir: '_site'
site: 'my-netlify-site'
prod: true
message: 'Deploy production ${{ github.ref }}'
- name: Deploy preview
id: deploy_preview
if: github.event_name == 'pull_request'
uses: data-intuitive/netlify-deploy-site@v1
with:
auth: ${{ secrets.NETLIFY_AUTH_TOKEN }}
dir: '_site'
site: 'my-netlify-site'
alias: "${{ env.BRANCH_NAME }}"
message: 'Deploy prooduction ${{ github.ref }}'
- uses: thollander/actions-comment-pull-request@v2
if: github.event_name == 'pull_request'
with:
message: |
[![Deploy: success](https://img.shields.io/badge/Deploy-success-success)](${{ steps.deploy_preview.outputs.deploy-url }})
comment_tag: deploy_status
- uses: thollander/actions-comment-pull-request@v2
if: github.event_name == 'pull_request' && failure()
with:
message: |
[![Deploy: failure](https://img.shields.io/badge/Deploy-failure-critical)]${{ steps.deploy_preview.outputs.logs }})
comment_tag: deploy_status
```