Merge pull request #132 from teaxyz/ops/optimize-gha-workflows

optimize GHA workflow by folder changes
This commit is contained in:
Neil 2022-10-24 20:34:10 +08:00 committed by GitHub
commit 60153f1d77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 4 deletions

View file

@ -9,10 +9,33 @@ env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
jobs:
deploy_sls:
validation:
runs-on: ubuntu-latest
outputs:
website: ${{steps.website.outputs.src}}
lambdas: ${{steps.lambdas.outputs.lambdas}}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: website
with:
filters: |
src:
- 'src/**'
- uses: dorny/paths-filter@v2
id: lambdas
with:
filters: |
lambdas:
- 'lambdas/**'
serverless:
needs: validation
if: needs.validation.outputs.lambdas == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
@ -30,6 +53,8 @@ jobs:
entrypoint: /bin/sh
deploy:
needs: validation
if: needs.validation.outputs.website == 'true'
runs-on: ubuntu-latest
steps:
- name: inject slug/short variables
@ -72,7 +97,6 @@ jobs:
with:
cmd: '.github/prepare-thumb-images.sh src/data/packages.json ./src/static/Images/packages/'
- run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}
- uses: teaxyz/setup@v0

View file

@ -39,6 +39,7 @@ interface FinalPackageOutput {
interface AirtablePackageDict {
[slug: string]: AirtablePackage
}
const getFinalPackagesData = async (s3Packages: S3Package[], airtablePackages: AirtablePackage[]): Promise<FinalPackageOutput> => {
const newPackages: NewAirtablePackage[] = [];
const packagesJson: Package[] = [];
@ -75,6 +76,7 @@ const getFinalPackagesData = async (s3Packages: S3Package[], airtablePackages: A
homepage,
desc,
installs: 0, // TODO: get from algolia
dl_count: 0,
thumb_image_url: '',
}
newPackages.push(newPackage);
@ -88,5 +90,4 @@ const getFinalPackagesData = async (s3Packages: S3Package[], airtablePackages: A
}
}
export const main = buildPackages;

View file

@ -20,7 +20,6 @@
position:relative;
z-index: 2;
}
</style>
<section class="hero-section">