Skip to content

Commit 3138c05

Browse files
authored
Merge pull request #70 from actions/v2-docs-improvements
Update README for `v2`
2 parents 84bb4cd + 07f501f commit 3138c05

File tree

1 file changed

+33
-29
lines changed

1 file changed

+33
-29
lines changed

README.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
A composite Action for packaging and uploading artifact that can be deployed to [GitHub Pages][pages].
44

5-
# Scope
5+
## Scope
66

77
⚠️ Official support for building Pages with Actions is in public beta at the moment.
88

9-
# Usage
9+
## Usage
1010

1111
See [action.yml](action.yml)
1212

1313
<!-- TODO: document custom workflow -->
1414

15-
# Artifact validation
15+
## Artifact validation
1616

1717
While using this action is optional, we highly recommend it since it takes care of producing (mostly) valid artifacts.
1818

@@ -25,8 +25,9 @@ The [`tar` file][tar] must:
2525

2626
- be under 10GB in size
2727
- not contain any symbolic or hard links
28+
- contain only files and directories that all meet the expected minimum [file permissions](#file-permissions)
2829

29-
# File Permissions
30+
### File permissions
3031

3132
When using this action, ensure that your files have appropriate file permissions.
3233
At a minimum, GitHub Pages expects:
@@ -35,34 +36,37 @@ At a minimum, GitHub Pages expects:
3536

3637
Failure to supply adequate permissions will result in a `deployment_perms_error` when attempting to deploy your artifacts to GitHub Pages.
3738

39+
#### Example permissions fix for Linux
40+
3841
```yaml
39-
...
40-
runs:
41-
using: composite
42-
steps:
43-
- name: Archive artifact
44-
shell: sh
45-
if: runner.os == 'Linux'
46-
run: |
47-
chmod -c -R +rX "$INPUT_PATH" |
48-
while read line; do
49-
echo "::warning title=Invalid file permissions automatically fixed::$line"
50-
done
51-
tar \
52-
--dereference --hard-dereference \
53-
--directory "$INPUT_PATH" \
54-
-cvf "$RUNNER_TEMP/artifact.tar" \
55-
--exclude=.git \
56-
--exclude=.github \
57-
.
58-
env:
59-
INPUT_PATH: ${{ inputs.path }}
60-
61-
...
42+
steps:
43+
# ...
44+
- name: Fix permissions
45+
run: |
46+
chmod -c -R +rX "_site/" | while read line; do
47+
echo "::warning title=Invalid file permissions automatically fixed::$line"
48+
done
49+
- name: Upload Pages artifact
50+
uses: actions/upload-pages-artifact@v2
51+
# ...
6252
```
6353

54+
#### Example permissions fix for Mac
55+
56+
```yaml
57+
steps:
58+
# ...
59+
- name: Fix permissions
60+
run: |
61+
chmod -v -R +rX "_site/" | while read line; do
62+
echo "::warning title=Invalid file permissions automatically fixed::$line"
63+
done
64+
- name: Upload Pages artifact
65+
uses: actions/upload-pages-artifact@v2
66+
# ...
67+
```
6468

65-
# Release instructions
69+
## Release instructions
6670

6771
In order to release a new version of this Action:
6872

@@ -74,7 +78,7 @@ In order to release a new version of this Action:
7478

7579
⚠️ Environment approval is required. Check the [Release workflow run list][release-workflow-runs].
7680

77-
# License
81+
## License
7882

7983
The scripts and documentation in this project are released under the [MIT License](LICENSE).
8084

0 commit comments

Comments
 (0)