Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanoverna committed Dec 13, 2024
1 parent c9bc121 commit bed510b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,10 @@ jobs:
GITHUB_CONTAINER_REGISTRY_API_TOKEN: ${{ secrets.GCR_API_TOKEN }}
PRIVATE_KEY: ${{ secrets.KAVO_PRIVATE_KEY }}
run: |
sed -i -E -e 's/\-\-break 0/--wrap=0/g' -e '/^SECRETS=/d' -e 's/^GITHUB_CONTAINER_REGISTRY_API_TOKEN=.*$/GITHUB_CONTAINER_REGISTRY_API_TOKEN=$GITHUB_CONTAINER_REGISTRY_API_TOKEN/' .kamal/secrets.$KAMAL_DESTINATION
echo $(npx kavo files:decrypt .env.staging -o | base64 --wrap=0)
echo "Tweaking .kamal/secrets.$KAMAL_DESTINATION"
sed -i -E -e 's/\-\-break 0/--wrap=0/g' .kamal/secrets.$KAMAL_DESTINATION
cat .kamal/secrets.$KAMAL_DESTINATION
echo -n $GITHUB_CONTAINER_REGISTRY_API_TOKEN | md5sum
ruby -e 'require "dotenv"; puts ::Dotenv.parse(".kamal/secrets.staging").inspect'
kamal deploy -d $KAMAL_DESTINATION
16 changes: 1 addition & 15 deletions .kamal/secrets.staging
Original file line number Diff line number Diff line change
@@ -1,15 +1 @@
KAVO_SECRETS=$(npx kavo files:decrypt .env.staging -o | base64 --break 0)

DATOCMS_API_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^DATOCMS_API_TOKEN=//p')
FASTLY_KEY=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^FASTLY_KEY=//p')
FASTLY_SERVICE_ID=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^FASTLY_SERVICE_ID=//p')
MAILERLITE_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^MAILERLITE_TOKEN=//p')
PIPEDRIVE_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^PIPEDRIVE_TOKEN=//p')
RECAPTCHA_KEY=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^RECAPTCHA_KEY=//p')
RECAPTCHA_SECRET_KEY=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^RECAPTCHA_SECRET_KEY=//p')
ROLLBAR_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^ROLLBAR_TOKEN=//p')
SECRET_API_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^SECRET_API_TOKEN=//p')
SLACK_TOKEN=$(echo $KAVO_SECRETS | base64 --decode | sed -n 's/^SLACK_TOKEN=//p')

SECRETS=$(kamal secrets fetch --adapter bitwarden --account [email protected] GITHUB_CONTAINER_REGISTRY_API_TOKEN)
GITHUB_CONTAINER_REGISTRY_API_TOKEN=$(kamal secrets extract GITHUB_CONTAINER_REGISTRY_API_TOKEN $SECRETS)
GITHUB_CONTAINER_REGISTRY_API_TOKEN=puppa

0 comments on commit bed510b

Please sign in to comment.