Skip to content

Commit

Permalink
chore(ci/cd): dotenv to secret (#520)
Browse files Browse the repository at this point in the history
  • Loading branch information
2paperstar authored Nov 18, 2024
1 parent 52d4e19 commit e88ebcf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ jobs:
- uses: subosito/flutter-action@v2
if: env.run == 'true'
with:
flutter-version: '3.24.5'
channel: 'stable'
flutter-version: "3.24.5"
channel: "stable"
cache: true
- uses: actions/cache@v4
if: env.run == 'true'
Expand All @@ -91,19 +91,22 @@ jobs:
- uses: actions/setup-java@v4
if: env.run == 'true' && matrix.os == 'Android'
with:
java-version: '17'
distribution: 'adopt'
java-version: "17"
distribution: "adopt"

- uses: ruby/setup-ruby@v1
if: env.run == 'true'
with:
ruby-version: '3.2.0'
ruby-version: "3.2.0"
bundler-cache: true
working-directory: ${{ env.directory }}

- name: Copy dotenv
if: env.run == 'true'
run: echo '${{ vars.DOTENV }}' > .env
run: |
echo '${{ vars.DOTENV }}' > .env
echo "AMPLITUDE_API_KEY=${{ secrets.AMPLITUDE_API_KEY }}" >> .env
echo "SMARTLOOK_API_KEY=${{ secrets.SMARTLOOK_API_KEY }}" >> .env
- name: Generate files
if: env.run == 'true'
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,19 @@ jobs:
- uses: actions/setup-java@v4
if: matrix.os == 'Android'
with:
java-version: '17'
distribution: 'adopt'
java-version: "17"
distribution: "adopt"

- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2.0'
ruby-version: "3.2.0"
bundler-cache: true
working-directory: ${{ env.directory }}

- uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.5'
channel: 'stable'
flutter-version: "3.24.5"
channel: "stable"
cache: true
- uses: actions/cache@v4
with:
Expand All @@ -82,7 +82,10 @@ jobs:
key: cocoapods-${{ hashFiles('ios/Podfile.lock') }}

- name: Copy dotenv
run: echo '${{ vars.DOTENV }}' > .env
run: |
echo '${{ vars.DOTENV }}' > .env
echo "AMPLITUDE_API_KEY=${{ secrets.AMPLITUDE_API_KEY }}" >> .env
echo "SMARTLOOK_API_KEY=${{ secrets.SMARTLOOK_API_KEY }}" >> .env
- name: Generate files
run: |
Expand All @@ -107,7 +110,7 @@ jobs:
status: ${{ job.status }}
author_name: Github Action Build
mention: ${{ secrets.SLACK_MENTION }}
if_mention: 'failure,cancelled'
if_mention: "failure,cancelled"
fields: repo,message,commit,author,action,eventName,ref,workflow,job,took
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

0 comments on commit e88ebcf

Please sign in to comment.