Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

polarathene
Copy link
Member

@polarathene polarathene commented Jan 26, 2024

Description

Unverified, but should match what the v4 docs expect.

This action is handles initial setup of the deployment workflow (for doc previews to Netlify).

EDIT: This was accidentally merged with a bug because I'm an idiot that missed the difference in similar parameter name due to _ => -.

Reference:


Context

The 1st part that builds docs for PRs without trust for security reasons (as documented in the original PR for this workflow) uploads the artifact to be deployed as shown here:

# ============================== #
# Volley over to secure workflow #
# ============================== #
# Minimize risk of upload failure by bundling files to a single compressed archive (tar + zstd).
# Bundles build dir and env file into a compressed archive, nested file paths will be preserved.
- name: 'Prepare artifact for transfer'
env:
# As a precaution, reference this value by an interpolated ENV var;
# instead of interpolating user controllable input directly in the shell script..
# https://github.com/docker-mailserver/docker-mailserver/issues/2332#issuecomment-998326798
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
# Save ENV for transfer
{
echo "PR_HEADSHA=${{ github.event.pull_request.head.sha }}"
echo "PR_NUMBER=${{ github.event.pull_request.number }}"
echo "PR_TITLE=${PR_TITLE}"
echo "NETLIFY_SITE_PREFIX=${{ env.NETLIFY_SITE_PREFIX }}"
echo "BUILD_DIR=${{ env.BUILD_DIR }}"
} >> pr.env
tar --zstd -cf artifact.tar.zst pr.env ${{ env.BUILD_DIR }}
- name: 'Upload artifact for workflow transfer'
uses: actions/upload-artifact@v4
with:
name: preview-build
path: artifact.tar.zst
retention-days: 1

With required secrets in deployment (GH Token + Netfliy):

NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

Type of change

  • Improvement (non-breaking change that does improve existing functionality)

…` action

v4 of the official action now supports this use-case.
@polarathene polarathene added area/ci kind/improvement Improve an existing feature, configuration file or the documentation area/documentation labels Jan 26, 2024
@polarathene polarathene added this to the v14.0.0 milestone Jan 26, 2024
@polarathene polarathene self-assigned this Jan 26, 2024
@polarathene polarathene merged commit a8ccd54 into master Jan 27, 2024
@polarathene polarathene deleted the ci/preview-deploy-use-official-action-v4-download-artifact branch January 27, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci area/documentation kind/improvement Improve an existing feature, configuration file or the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.