Skip to content

Commit

Permalink
Migrate to new GH action (#204)
Browse files Browse the repository at this point in the history
* Migrate to new GH action

* Update action link
  • Loading branch information
0xTim authored Jul 21, 2024
1 parent e2dcd78 commit 884a82d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 23 deletions.
25 changes: 3 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ jobs:
name: Build and Deploy
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
if: ${{ github.event.pull_request.head.repo.full_name == 'vapor/design' && github.actor != 'dependabot[bot]' }}
with:
aws-access-key-id: ${{ secrets.DESIGN_DEPLOYER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DESIGN_DEPLOYER_AWS_SECRET_ACCESS_KEY }}
aws-region: 'us-east-1'
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node
Expand All @@ -36,25 +29,13 @@ jobs:
run: npm install
- name: Build Node website
run: npm run build
- name: Create S3 Bucket
if: ${{ github.event.pull_request.head.repo.full_name == 'vapor/design' && github.actor != 'dependabot[bot]' }}
env:
BUCKET: ${{ format('vapor-design-pulls-pr{0}', github.event.number) }}
run: |
if aws s3api head-bucket --bucket ${BUCKET} 2>/dev/null; then
echo "Bucket already exists"
else
aws s3 mb s3://${BUCKET}
aws s3api delete-public-access-block --bucket ${BUCKET}
aws s3api delete-bucket-ownership-controls --bucket ${BUCKET}
aws s3api put-bucket-website --bucket ${BUCKET} \
--website-configuration '{"IndexDocument":{"Suffix":"index.html"},"ErrorDocument":{"Key":"404.html"}}'
fi
- name: Deploy S3 Website
if: ${{ github.event.pull_request.head.repo.full_name == 'vapor/design' && github.actor != 'dependabot[bot]' }}
uses: brokenhandsio/s3-website-https-pr-action@1.0.0
uses: brokenhandsio/s3-website-pr-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.DESIGN_DEPLOYER_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DESIGN_DEPLOYER_AWS_SECRET_ACCESS_KEY }}
with:
bucket-prefix: "vapor-design-pulls"
folder-to-copy: "./Output"
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/prs-closed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:

steps:
- name: Delete Website Bucket
uses: rishabhrao/s3-website-https-pr-action@v1
uses: brokenhandsio/s3-website-pr-action@v2
with:
bucket-prefix: "vapor-design-pulls"
bucket-region: "us-east-1"

0 comments on commit 884a82d

Please sign in to comment.