diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 1581e37..eb65703 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -25,13 +25,13 @@ jobs: CF_ZONE_ID: ${{ secrets.CF_ZONE_ID }} CF_DEPLOY_DOMAIN: ${{ secrets.CF_DEPLOY_DOMAIN }} - # this is needed to get the lowercase version of the actor name + # this is needed to get the lowercase version of the repository_owner name # TODO: switch to some lowercase function in the future when Actions supports it - - name: Set lowercase actor name + - name: Set lowercase repository_owner name run: | - echo $GH_ACTOR | awk '{ print "ACTOR_LOWER=" tolower($0) }' >> ${GITHUB_ENV} + echo $GH_OWNER | awk '{ print "OWNER_LOWER=" tolower($0) }' >> ${GITHUB_ENV} env: - GH_ACTOR: ${{ github.actor }} + GH_OWNER: ${{ github.repository_owner }} - uses: actions/checkout@v2 - uses: hashicorp/setup-terraform@v2 @@ -48,7 +48,7 @@ jobs: - name: Create D1 database uses: cloudflare/wrangler-action@2.0.0 with: - command: d1 create wildebeest-${{ env.ACTOR_LOWER }} + command: d1 create wildebeest-${{ env.OWNER_LOWER }} apiToken: ${{ secrets.CF_API_TOKEN }} continue-on-error: true env: @@ -57,7 +57,7 @@ jobs: - name: retrieve D1 database uses: cloudflare/wrangler-action@2.0.0 with: - command: d1 list | grep wildebeest-${{ env.ACTOR_LOWER }} | awk '{print "d1_id="$2}' >> $GITHUB_ENV + command: d1 list | grep wildebeest-${{ env.OWNER_LOWER }} | awk '{print "d1_id="$2}' >> $GITHUB_ENV apiToken: ${{ secrets.CF_API_TOKEN }} env: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} @@ -65,11 +65,11 @@ jobs: - name: migrate D1 database uses: cloudflare/wrangler-action@2.0.0 with: - command: d1 migrations apply wildebeest-${{ env.ACTOR_LOWER }} + command: d1 migrations apply wildebeest-${{ env.OWNER_LOWER }} apiToken: ${{ secrets.CF_API_TOKEN }} preCommands: | echo "*** pre commands ***" - echo -e "[[d1_databases]]\nbinding=\"DATABASE\"\ndatabase_name=\"wildebeest-${{ env.ACTOR_LOWER }}\"\ndatabase_id=\"${{ env.d1_id }}\"" >> wrangler.toml + echo -e "[[d1_databases]]\nbinding=\"DATABASE\"\ndatabase_name=\"wildebeest-${{ env.OWNER_LOWER }}\"\ndatabase_id=\"${{ env.d1_id }}\"" >> wrangler.toml echo "******" env: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }} @@ -93,7 +93,7 @@ jobs: TF_VAR_cloudflare_api_token: ${{ secrets.CF_API_TOKEN }} TF_VAR_cloudflare_zone_id: ${{ secrets.CF_ZONE_ID }} TF_VAR_cloudflare_deploy_domain: ${{ secrets.CF_DEPLOY_DOMAIN }} - TF_VAR_gh_username: ${{ env.ACTOR_LOWER }} + TF_VAR_gh_username: ${{ env.OWNER_LOWER }} TF_VAR_d1_id: ${{ env.d1_id }} TF_VAR_access_auth_domain: ${{ env.auth_domain }} @@ -107,6 +107,6 @@ jobs: yarn build cp -rv ./frontend/dist/* . echo "******" - command: pages publish --project-name=wildebeest-${{ env.ACTOR_LOWER }} . + command: pages publish --project-name=wildebeest-${{ env.OWNER_LOWER }} . env: CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}