Update JWTKit post for beta 3 #142
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and deploy blog.vapor.codes | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
container: swift:5.9-jammy | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.BLOG_DEPLOYER_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.BLOG_DEPLOYER_AWS_SECRET_ACCESS_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
AWS_REGION: 'us-east-1' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
apt-get update | |
apt-get install -y curl | |
- name: Setup cloudformation lint | |
uses: ScottBrenner/cfn-lint-action@v2 | |
- name: Run cloudformation lint | |
run: cfn-lint -t stack.yaml | |
- name: Build site | |
run: swift run | |
- name: Install AWS CLI | |
run: | | |
apt-get update && apt-get install -y unzip | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
unzip awscliv2.zip | |
./aws/install | |
- name: Create Bucket with correct permissions | |
if: ${{ github.event.pull_request.head.repo.full_name == 'vapor/blog' && github.actor != 'dependabot[bot]' }} | |
run: | | |
if aws s3api head-bucket --bucket vapor-blog-pull-pr${{github.event.number}} 2>/dev/null; then | |
echo "Bucket already exists" | |
else | |
aws s3 mb s3://vapor-blog-pull-pr${{github.event.number}} | |
aws s3api delete-public-access-block --bucket vapor-blog-pull-pr${{github.event.number}} | |
aws s3api delete-bucket-ownership-controls --bucket vapor-blog-pull-pr${{github.event.number}} | |
aws s3api put-bucket-website --bucket vapor-blog-pull-pr${{github.event.number}} \ | |
--website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}' | |
fi | |
- name: Deploy S3 Website | |
uses: rishabhrao/s3-website-https-pr-action@v1 | |
if: ${{ github.event.pull_request.head.repo.full_name == 'vapor/blog' && github.actor != 'dependabot[bot]' }} | |
with: | |
bucket-prefix: "vapor-blog-pull" | |
folder-to-copy: "./Output" |