|
1 | 1 | ---
|
2 | 2 | name: Netlify Deploy Site
|
3 | 3 | author: Data Intuitive
|
4 |
| -description: | |
5 |
| - Deploy a site to Netlify. |
| 4 | +description: Deploy a site to Netlify. |
6 | 5 | inputs:
|
7 | 6 | auth:
|
8 | 7 | description: Netlify auth token to deploy with. Generate the auth token [here](https://app.netlify.com/user/applications#personal-access-tokens).
|
@@ -44,53 +43,53 @@ outputs:
|
44 | 43 | runs:
|
45 | 44 | using: composite
|
46 | 45 | steps:
|
47 |
| - - shell: bash |
48 |
| - id: netlify-deploy |
49 |
| - env: |
50 |
| - NETLIFY_AUTH_TOKEN: ${{ inputs.NETLIFY_AUTH_TOKEN }} |
51 |
| - NETLIFY_SITE_ID: ${{ inputs.NETLIFY_SITE_ID }} |
52 |
| - run: | |
53 |
| - ARGS=() |
54 |
| - |
55 |
| - # process auth |
56 |
| - if [[ -n "${{ inputs.auth }}" ]]; then |
57 |
| - ARGS+=("--auth=${{ inputs.auth }}") |
58 |
| - fi |
| 46 | + - shell: bash |
| 47 | + id: netlify-deploy |
| 48 | + env: |
| 49 | + NETLIFY_AUTH_TOKEN: ${{ inputs.NETLIFY_AUTH_TOKEN }} |
| 50 | + NETLIFY_SITE_ID: ${{ inputs.NETLIFY_SITE_ID }} |
| 51 | + run: | |
| 52 | + ARGS=() |
| 53 | + |
| 54 | + # process auth |
| 55 | + if [[ -n "${{ inputs.auth }}" ]]; then |
| 56 | + ARGS+=("--auth=${{ inputs.auth }}") |
| 57 | + fi |
59 | 58 |
|
60 |
| - # process prod and alias |
61 |
| - if [[ "${{ inputs.prod }}" == "true" ]]; then |
62 |
| - ARGS+=("--prod") |
63 |
| - elif [[ -n "${{ inputs.alias }}" ]]; then |
64 |
| - ARGS+=("--alias=${{ inputs.alias }}") |
65 |
| - fi |
| 59 | + # process prod and alias |
| 60 | + if [[ "${{ inputs.prod }}" == "true" ]]; then |
| 61 | + ARGS+=("--prod") |
| 62 | + elif [[ -n "${{ inputs.alias }}" ]]; then |
| 63 | + ARGS+=("--alias=${{ inputs.alias }}") |
| 64 | + fi |
66 | 65 |
|
67 |
| - # process dir |
68 |
| - if [[ -n "${{ inputs.dir }}" ]]; then |
69 |
| - ARGS+=("--dir=${{ inputs.dir }}") |
70 |
| - fi |
| 66 | + # process dir |
| 67 | + if [[ -n "${{ inputs.dir }}" ]]; then |
| 68 | + ARGS+=("--dir=${{ inputs.dir }}") |
| 69 | + fi |
71 | 70 |
|
72 |
| - # process message |
73 |
| - if [[ -n "${{ inputs.message }}" ]]; then |
74 |
| - ARGS+=("--message=${{ inputs.message }}") |
75 |
| - fi |
| 71 | + # process message |
| 72 | + if [[ -n "${{ inputs.message }}" ]]; then |
| 73 | + ARGS+=("--message=${{ inputs.message }}") |
| 74 | + fi |
76 | 75 |
|
77 |
| - # process site |
78 |
| - if [[ -n "${{ inputs.site }}" ]]; then |
79 |
| - ARGS+=("--site=${{ inputs.site }}") |
80 |
| - fi |
| 76 | + # process site |
| 77 | + if [[ -n "${{ inputs.site }}" ]]; then |
| 78 | + ARGS+=("--site=${{ inputs.site }}") |
| 79 | + fi |
81 | 80 |
|
82 |
| - # process timeout |
83 |
| - if [[ -n "${{ inputs.timeout }}" ]]; then |
84 |
| - ARGS+=("--timeout=${{ inputs.timeout }}") |
85 |
| - fi |
| 81 | + # process timeout |
| 82 | + if [[ -n "${{ inputs.timeout }}" ]]; then |
| 83 | + ARGS+=("--timeout=${{ inputs.timeout }}") |
| 84 | + fi |
86 | 85 |
|
87 |
| - TEMP_JSON="${{runner.temp}}/output.json" |
88 |
| - netlify deploy --json --debug "${ARGS[@]}" | tee "$TEMP_JSON" |
| 86 | + TEMP_JSON="${{runner.temp}}/output.json" |
| 87 | + netlify deploy --json --debug "${ARGS[@]}" | tee "$TEMP_JSON" |
89 | 88 |
|
90 |
| - jq -r '"site-name=" + .site_name' "$TEMP_JSON" >> $GITHUB_OUTPUT |
91 |
| - jq -r '"deploy-id=" + .deploy_id' "$TEMP_JSON" >> $GITHUB_OUTPUT |
92 |
| - jq -r '"deploy-url=" + .deploy_url' "$TEMP_JSON" >> $GITHUB_OUTPUT |
93 |
| - jq -r '"logs=" + .logs' "$TEMP_JSON" >> $GITHUB_OUTPUT |
| 89 | + jq -r '"site-name=" + .site_name' "$TEMP_JSON" >> $GITHUB_OUTPUT |
| 90 | + jq -r '"deploy-id=" + .deploy_id' "$TEMP_JSON" >> $GITHUB_OUTPUT |
| 91 | + jq -r '"deploy-url=" + .deploy_url' "$TEMP_JSON" >> $GITHUB_OUTPUT |
| 92 | + jq -r '"logs=" + .logs' "$TEMP_JSON" >> $GITHUB_OUTPUT |
94 | 93 |
|
95 | 94 | branding:
|
96 | 95 | icon: arrow-up-circle
|
|
0 commit comments