@@ -90,17 +90,22 @@ jobs:
9090 echo "actor=$GITHUB_ACTOR repo=$GITHUB_REPOSITORY" >> meta/.deployed.txt
9191 cp meta/.deployed.txt www/
9292
93+ - name : Compute safe repo name
94+ id : vars
95+ run : |
96+ echo "safe_repo=${GITHUB_REPOSITORY//\//-}" >> "$GITHUB_OUTPUT"
97+
9398 - name : Sync www/ to S3
9499 run : |
95100 aws s3 sync \
96101 www/ \
97- s3://${{ inputs.s3_bucket }}/${{ github.repository.replace('/', '-') }}/staging/${GITHUB_SHA}/ \
102+ s3://${{ inputs.s3_bucket }}/${{ steps.vars.outputs.safe_repo }}/staging/${GITHUB_SHA}/ \
98103 --delete --exact-timestamps
99104
100105 - name : Deployment summary
101106 run : |
102107 {
103- echo "### Deployment staging to ${{ inputs.url_staging }}/${{ github.repository.replace('/', '-') }}/${GITHUB_SHA}"
108+ echo "### Deployment staging to ${{ inputs.url_staging }}/${{ steps.vars.outputs.safe_repo }}/${GITHUB_SHA}"
104109 echo "### It should be accessible in 5 minutes"
105110 } >> $GITHUB_STEP_SUMMARY
106111
@@ -146,18 +151,22 @@ jobs:
146151 with :
147152 role-to-assume : arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_ROLE_NAME_STAGING }}
148153 aws-region : ${{ inputs.aws_region }}
149-
150154
155+ - name : Compute safe repo name
156+ id : vars
157+ run : |
158+ echo "safe_repo=${GITHUB_REPOSITORY//\//-}" >> "$GITHUB_OUTPUT"
159+
151160 - name : Sync www/ to S3
152161 run : |
153162 aws s3 sync \
154- s3://${{ inputs.s3_bucket }}/${{ github.repository.replace('/', '-') }}/staging/${GITHUB_SHA}/ \
155- s3://${{ inputs.s3_bucket }}/${{ github.repository.replace('/', '-') }}/prod/ \
163+ s3://${{ inputs.s3_bucket }}/${{ steps.vars.outputs.safe_repo }}/staging/${GITHUB_SHA}/ \
164+ s3://${{ inputs.s3_bucket }}/${{ steps.vars.outputs.safe_repo }}/prod/ \
156165 --delete --exact-timestamps
157166
158167 - name : Check prod deployment
159168 run : |
160- DEPLOYED_URL="${{ inputs.url_staging }}/${{ github.repository.replace('/', '-') }}/${GITHUB_SHA}/.deployed.txt"
169+ DEPLOYED_URL="${{ inputs.url_staging }}/${{ steps.vars.outputs.safe_repo }}/${GITHUB_SHA}/.deployed.txt"
161170 for i in {1..10}; do
162171 DEPLOYED_SHA=$(curl -fsSL "$DEPLOYED_URL" 2>/dev/null | awk '{ print $1 }' || echo "")
163172 if [ "$DEPLOYED_SHA" = "$GITHUB_SHA" ]; then
0 commit comments