From 97cd4aedf89c1980903722a5c6a8503a1ee8a753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Casta=C3=B1o=20Arteaga?= Date: Wed, 9 Aug 2023 18:29:43 +0200 Subject: [PATCH] Add CNCF workflow (#1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sergio CastaƱo Arteaga --- .github/workflows/cncf.yml | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/cncf.yml diff --git a/.github/workflows/cncf.yml b/.github/workflows/cncf.yml new file mode 100644 index 0000000..d204a21 --- /dev/null +++ b/.github/workflows/cncf.yml @@ -0,0 +1,55 @@ +name: CNCF +on: + schedule: + - cron: "0 10 * * *" + +jobs: + build-and-deploy-landscape: + runs-on: ubuntu-latest + container: + image: public.ecr.aws/g6m3a0y9/landscape2 + options: --user root + steps: + - name: Checkout this repository + uses: actions/checkout@v3 + + - name: Checkout cncf/landscape repository + uses: actions/checkout@v3 + with: + repository: "cncf/landscape" + path: "./landscape" + sparse-checkout: | + hosted_logos + + - name: Install tar in container (needed for the cache) + run: apk add --update --no-progress tar + + - name: Setup cache + uses: actions/cache@v3 + with: + path: /tmp/landscape-cache + key: landscape-cache-cncf-${ github.sha }} + restore-keys: | + landscape-cache-cncf- + + - name: Build landscape + env: + GITHUB_TOKENS: ${{ secrets.GH_TOKENS }} + CRUNCHBASE_API_KEY: ${{ secrets.CRUNCHBASE_API_KEY }} + run: | + landscape2 build \ + --settings-file ./cncf/settings.yml \ + --data-file ./landscape/landscape.yml \ + --logos-path ./landscape/hosted_logos \ + --cache-dir /tmp/landscape-cache \ + --output-dir /tmp/landscape + + - name: Deploy landscape + env: + AWS_REGION: "us-east-2" + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + run: | + landscape2 deploy s3 \ + --bucket landscape2-prototype-demo \ + --landscape-dir /tmp/landscape