Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-site-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
ENVIRONMENT: ${{ inputs.environment }}
run: |
set -Eeuo pipefail
rsync -az --mkpath --chmod=D755,F644 \
rsync -az --mkpath --no-g --chmod=D2755,F644 \
--link-dest="/${ENVIRONMENT}/current/" \
-e "ssh -i ~/.ssh/deploy -o IdentitiesOnly=yes" \
"${RUNNER_TEMP}/bundle/releases/${RELEASE_ID}/" \
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,8 @@ concurrency:

jobs:

# The same gate the pull request and a release run.
validate:
name: Validate sources job
uses: ./.github/workflows/validate-task.yml
permissions:
contents: read

# Staging deploys from any ref, since proving a branch before it merges is what staging is for.
# Asserted before Hugo is installed and before the key reaches the runner.
# First, so a mis-dispatched production deploy fails before anything is installed or written.
assert-ref:
name: Assert deploy ref job
runs-on: ubuntu-latest
Expand All @@ -39,9 +32,17 @@ jobs:
exit 1
fi

# The same gate the pull request and a release run.
validate:
name: Validate sources job
needs: [ assert-ref ]
uses: ./.github/workflows/validate-task.yml
permissions:
contents: read

deploy:
name: Deploy site job
needs: [ validate, assert-ref ]
needs: [ validate ]
uses: ./.github/workflows/deploy-site-task.yml
with:
environment: ${{ inputs.environment }}
Expand Down
7 changes: 6 additions & 1 deletion deploy/make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# The first argument overrides the root, being read after this.
DEFAULT_ENV_FILE="$REPO/secrets/.env"
ENV_FILE="${ENV_FILE:-$DEFAULT_ENV_FILE}"
# Anchored under the repo, so a relative name resolves the same from any working directory.
# A relative name resolves against the repo, so it means the same from any working directory.
# Traversal is refused rather than resolved, since a relative name is meant to reach secrets/.
case "$ENV_FILE" in
/*) ;;
*..*)
echo "ENV_FILE must not traverse: $ENV_FILE" >&2
exit 1
;;
*) ENV_FILE="$REPO/$ENV_FILE" ;;
esac
if [ -f "$ENV_FILE" ]; then
Expand Down