Skip to content

Commit

Permalink
Merge pull request #62 from university-of-york/hotfix/github-action-2
Browse files Browse the repository at this point in the history
Bucket name and distribution id correctly saved
  • Loading branch information
stulacy authored Oct 4, 2023
2 parents 97ba95e + 89c0705 commit c27f669
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
content:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11.3'
Expand All @@ -39,17 +39,17 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Build site
run: sphinx-build -b html docs/source/ site/
run: TZ=UTC sphinx-build -b html docs/source/ site/
- name: Get Bucket name
id: get-bucket
run: |
echo "{BUCKET_NAME}=$(aws cloudformation describe-stacks --stack-name ResearchITWebsiteStack --query 'Stacks[0].Outputs[?OutputKey==`BucketName`].OutputValue' --output=text)" >> "$GITHUB_OUTPUT"
echo "BUCKET_NAME=$(aws cloudformation describe-stacks --stack-name ResearchITWebsiteStack --query 'Stacks[0].Outputs[?OutputKey==`BucketName`].OutputValue' --output=text)" >> "$GITHUB_OUTPUT"
- name: Get CloudFront distribution id
id: get-distribution-id
run: |
echo "{DISTRIBUTION_ID}=$(aws cloudformation describe-stacks --stack-name ResearchITWebsiteStack --query 'Stacks[0].Outputs[?OutputKey==`CloudFrontDistributionID`].OutputValue' --output=text)" >> "$GITHUB_OUTPUT"
echo "DISTRIBUTION_ID=$(aws cloudformation describe-stacks --stack-name ResearchITWebsiteStack --query 'Stacks[0].Outputs[?OutputKey==`CloudFrontDistributionID`].OutputValue' --output=text)" >> "$GITHUB_OUTPUT"
- name: Push to S3
run: aws s3 sync site/. s3://${{steps.get-bucket.outputs.BUCKET_NAME}}
run: aws s3 sync site/. s3://${{ steps.get-bucket.outputs.BUCKET_NAME }}
- name: Invalidate CloudFront distribution
run: |
aws cloudfront create-invalidation --distribution-id ${{steps.get-distribution-id.outputs.DISTRIBUTION_ID}} --paths "/*"
aws cloudfront create-invalidation --distribution-id ${{ steps.get-distribution-id.outputs.DISTRIBUTION_ID }} --paths "/*"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.env
.venv
site/*
*.pyc

0 comments on commit c27f669

Please sign in to comment.