Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update static-website action to ubuntu 24 #596

Merged
merged 1 commit into from
Oct 2, 2024
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
14 changes: 12 additions & 2 deletions github-actions/static-websites/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
FROM ubuntu:bionic
FROM ubuntu:24.04

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y git awscli
RUN set -eux; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
git \
curl \
unzip \
; \
curl "https://awscli.amazonaws.com/awscli-exe-linux-$(arch).zip" -o "awscliv2.zip"; \
unzip awscliv2.zip; \
rm awscliv2.zip; \
./aws/install

COPY entrypoint.sh /entrypoint.sh

Expand Down
6 changes: 6 additions & 0 deletions github-actions/static-websites/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ cloudfront_distribution="${INPUT_CLOUDFRONT_DISTRIBUTION-}"

export AWS_ACCESS_KEY_ID="${INPUT_AWS_ACCESS_KEY_ID-}"
export AWS_SECRET_ACCESS_KEY="${INPUT_AWS_SECRET_ACCESS_KEY-}"
# The region is required by the AWS CLI, but it doesn't matter
# because CloudFront is a global service.
export AWS_DEFAULT_REGION="us-west-1"

# Ensure GitHub doesn't mess around with the uploaded file.
# Without the file, for example, files with an underscore in the name won't be
Expand All @@ -25,6 +28,9 @@ git add .
git commit -m "Deploy ${GITHUB_SHA} to gh-pages"
git push -f "https://x-token:${github_token}@github.com/${GITHUB_REPOSITORY}" master:gh-pages

# Print the AWS CLI version
aws --version

# Invalidate the CloudFront caches to prevent stale content from being served.
if [[ -n "${cloudfront_distribution}" ]]; then
aws cloudfront create-invalidation --distribution-id "${cloudfront_distribution}" --paths "/*"
Expand Down
Loading