Drop claude github workflows #237
This file contains hidden or 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: Deploy to AWS S3/CloudFront | |
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: read | |
| concurrency: | |
| group: "cloudfront" | |
| cancel-in-progress: true | |
| # Default to bash | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| # Build job | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| with: | |
| submodules: recursive | |
| - name: Extract versions from go.mod | |
| id: versions | |
| run: | | |
| HUGO_VERSION=$(grep 'github.com/gohugoio/hugo' go.mod | awk '{print $2}' | sed 's/^v//') | |
| S3DEPLOY_VERSION=$(grep 'github.com/bep/s3deploy' go.mod | awk '{print $2}' | sed 's/^v//') | |
| echo "hugo=${HUGO_VERSION}" >> $GITHUB_OUTPUT | |
| echo "s3deploy=${S3DEPLOY_VERSION}" >> $GITHUB_OUTPUT | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v3 | |
| with: | |
| hugo-version: "${{ steps.versions.outputs.hugo }}" | |
| extended: true | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1 | |
| with: | |
| role-to-assume: arn:aws:iam::911986281031:role/github-actions-major.io-blog | |
| role-duration-seconds: 900 | |
| aws-region: us-east-1 | |
| - name: Build with Hugo | |
| env: | |
| HUGO_ENVIRONMENT: production | |
| HUGO_ENV: production | |
| run: hugo --minify | |
| - name: Fix RSS feed | |
| run: | | |
| mkdir -vp public/feed | |
| cp public/index.xml public/feed/index.xml | |
| cp public/index.xml public/feed/index.html | |
| - name: Cache s3deploy | |
| id: cache-s3deploy | |
| uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5 | |
| with: | |
| path: s3deploy | |
| key: s3deploy-${{ steps.versions.outputs.s3deploy }}-linux-amd64 | |
| - name: Download s3deploy | |
| if: steps.cache-s3deploy.outputs.cache-hit != 'true' | |
| run: | | |
| curl -sLO https://github.com/bep/s3deploy/releases/download/v${{ steps.versions.outputs.s3deploy }}/s3deploy_${{ steps.versions.outputs.s3deploy }}_linux-amd64.tar.gz | |
| curl -sL https://github.com/bep/s3deploy/releases/download/v${{ steps.versions.outputs.s3deploy }}/s3deploy_${{ steps.versions.outputs.s3deploy }}_checksums.txt | grep linux-amd64.tar.gz | sha256sum -c - | |
| tar -xzf s3deploy_${{ steps.versions.outputs.s3deploy }}_linux-amd64.tar.gz s3deploy | |
| chmod +x s3deploy | |
| - name: Deploy to S3 using s3deploy | |
| run: | | |
| ./s3deploy \ | |
| --acl public-read \ | |
| --region us-east-1 \ | |
| --bucket major.io \ | |
| --source public \ | |
| --distribution-id E2CVUP8JO07HJ2 |