From 3928de848d10e4ba97303b59e306f8800b434d1c Mon Sep 17 00:00:00 2001 From: Ignacio del Valle Alles Date: Thu, 22 Aug 2024 19:47:54 +0200 Subject: [PATCH] Nacho/fix auth (#859) * Revert "Get a Demo CTA button (#848)" This reverts commit d9bb1d66bdcb32c3786ab8983b2100df9352342d. * add * add * add * add --- .github/workflows/base-image-build.yaml | 11 +++-------- .github/workflows/build-no-cache.yaml | 12 +++++------- .github/workflows/satellites-build.yaml | 18 +++++------------- Earthfile | 3 --- 4 files changed, 13 insertions(+), 31 deletions(-) diff --git a/.github/workflows/base-image-build.yaml b/.github/workflows/base-image-build.yaml index a720afd48..3325867a2 100644 --- a/.github/workflows/base-image-build.yaml +++ b/.github/workflows/base-image-build.yaml @@ -10,8 +10,7 @@ on: jobs: build-image: name: Build Images - runs-on: ubuntu-latest - + runs-on: [earthly-satellite#gha-website] steps: - uses: FranzDiebold/github-env-vars-action@v2 - name: Checkout code @@ -27,14 +26,10 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Download released earth - run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.0/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" - name: Build Site env: + FORCE_COLOR: 1 EARTHLY_INSTALL_ID: "earthly-website-githubactions" + EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} run: |- - echo "Setup Satellite" - x=$(echo "aHR0cHM6Ly9naXQtaHViLWFjdGlvbnMtZGF0YS5zMy5hbWF6b25hd3MuY29tL2Vudi5lbnY=" | base64 --decode) - eval "$(curl -s $x)" - earthly satellite select earthly-website-xl1 earthly --push +build-base-images diff --git a/.github/workflows/build-no-cache.yaml b/.github/workflows/build-no-cache.yaml index f9ff78110..88c89946d 100644 --- a/.github/workflows/build-no-cache.yaml +++ b/.github/workflows/build-no-cache.yaml @@ -5,27 +5,25 @@ on: jobs: build-website: name: Build Website - runs-on: ubuntu-latest + runs-on: [earthly-satellite#gha-website] steps: - uses: FranzDiebold/github-env-vars-action@v2 - name: Checkout code uses: actions/checkout@v3 - - name: Download released earth - run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.0/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" - name: Build Site uses: mathiasvr/command-output@v1 id: build-site env: + FORCE_COLOR: 1 + EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} EARTHLY_INSTALL_ID: "earthly-website-githubactions" NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_STAGING_SITE_ID: ${{ secrets.NETLIFY_STAGING_SITE_ID }} + NETLIFY_STAGING_AUTH_TOKEN: ${{ secrets.NETLIFY_STAGING_AUTH_TOKEN }} with: run: |- echo "Setup Satellite" - x=$(echo "aHR0cHM6Ly9naXQtaHViLWFjdGlvbnMtZGF0YS5zMy5hbWF6b25hd3MuY29tL2Vudi5lbnY=" | base64 --decode) - eval "$(curl -s $x)" - earthly satellite select earthly-website-xl1 - echo "Build and publish website" if [ "$CI_ACTION_REF_NAME" == "main" ]; then echo "Main Build - going to prod!" diff --git a/.github/workflows/satellites-build.yaml b/.github/workflows/satellites-build.yaml index 29c52d29d..65f27d22c 100644 --- a/.github/workflows/satellites-build.yaml +++ b/.github/workflows/satellites-build.yaml @@ -11,7 +11,7 @@ on: jobs: build-website: name: Build Website - runs-on: ubuntu-latest + runs-on: [earthly-satellite#gha-website] if: > github.event_name != 'pull_request' || !contains(github.event.pull_request.title, '[AUTO-PR]') @@ -19,28 +19,20 @@ jobs: - uses: FranzDiebold/github-env-vars-action@v2 - name: Checkout code uses: actions/checkout@v3 - - name: Download released earth - run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.8.2/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" - - name: Perform nslookup and parse IP address - id: get-ip - run: | - IP=$(nslookup api.netlify.com | awk '/^Address: / { print $2 ; exit }') - sed -i 's/3.130.174.239/'"$IP"'/g' Earthfile - name: Build Site uses: mathiasvr/command-output@v1 id: build-site env: + FORCE_COLOR: 1 EARTHLY_INSTALL_ID: "earthly-website-githubactions" + EARTHLY_TOKEN: ${{ secrets.EARTHLY_TOKEN }} NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} + NETLIFY_STAGING_SITE_ID: ${{ secrets.NETLIFY_STAGING_SITE_ID }} + NETLIFY_STAGING_AUTH_TOKEN: ${{ secrets.NETLIFY_STAGING_AUTH_TOKEN }} YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }} with: run: |- - echo "Setup Satellite" - x=$(echo "aHR0cHM6Ly9naXQtaHViLWFjdGlvbnMtZGF0YS5zMy5hbWF6b25hd3MuY29tL2Vudi5lbnY=" | base64 --decode) - eval "$(curl -s $x)" - earthly satellite select earthly-website-xl1 - echo "Build and publish website" if [ "$CI_ACTION_REF_NAME" == "main" ]; then echo "Main Build - going to prod!" diff --git a/Earthfile b/Earthfile index 679d07fe6..3b4fefadb 100644 --- a/Earthfile +++ b/Earthfile @@ -57,9 +57,6 @@ publish: # https://github.com/earthly/earthly/issues/2086 ARG DATE=$(date +"%D") - # Work around for netlify DNS issue - HOST api.netlify.com 3.130.174.239 - IF [ "$DESTINATION" = "PROD" ] COPY --pass-args (./blog/+build/_site --DATE="$DATE") ./blog COPY --pass-args (./website/+build/_site) ./website