Skip to content

Commit

Permalink
add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Dec 6, 2024
1 parent 378fd79 commit 18b26a5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ jobs:
with:
root: packages/nuejs.org

# keep server running in background
- name: Run server
run: nue -pr packages/nuejs.org -P 8080 &

# find generated HTML files, convert paths to urls
- name: Find files to check
id: files
run: |
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/push-examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
dir:
dir: # dirs in "examples" to run build & push process for
- simple-blog

env:
Expand All @@ -29,17 +29,18 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
with: # get entries to check for change in dir
fetch-depth: 2

- name: Check dir changes
id: changes
run: git diff --name-only HEAD^ HEAD | grep -q "^${{ env.dir }}"

# creates archive of dir, removes img dirs, moves content to subdir "source"
- name: Create test archive
run: tar --exclude "*/img" --transform "s/^\./source/" -C "${{ env.dir }}" -cf "${{ env.dir }}test.tar.gz" .
run: tar -C "${{ env.dir }}" --exclude "*/img" --transform "s/^\./source/" -cf "${{ env.dir }}test.tar.gz" .
if: ${{ matrix.dir == 'simple-blog' }}

# creates archive of dir, moves content to subdir "source"
- name: Create source archive
run: git archive --prefix "source/" -o "${{ env.dir }}source.tar.gz" HEAD:${{ env.dir }}

Expand All @@ -55,6 +56,7 @@ jobs:
ssh-private-key: ${{ secrets.SSH_PRIVATE }}
ssh-host: ${{ secrets.SSH_HOST }}

# copies built site archive to server, unpacks archive on server
- name: Push files to web server
run: |
scp "${{ env.archive }}" ${{ env.host }}@${{ secrets.SSH_HOST }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/push-site.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
ssh-private-key: ${{ secrets.SSH_PRIVATE }}
ssh-host: ${{ secrets.SSH_HOST }}

# copies built site archive to server, unpacks archive on server
- name: Push files to web server
run: |
scp "${{ env.archive }}" ${{ env.host }}@${{ secrets.SSH_HOST }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/repo/build-page/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ runs:
shell: bash
run: nue build -pr "${{ inputs.root }}"

# archive generated site, remove leading "./" from file paths in archive
- name: Archive files
if: ${{ inputs.archive }}
shell: bash
run: tar --transform "s/^\.\///" -C "${{ inputs.root }}.dist/prod" -czf "${{ inputs.archive }}" .
run: tar -C "${{ inputs.root }}.dist/prod" --transform "s/^\.\///" -czf "${{ inputs.archive }}" .

0 comments on commit 18b26a5

Please sign in to comment.