Skip to content

Commit

Permalink
Use env context instead of secrets context
Browse files Browse the repository at this point in the history
  • Loading branch information
DasSkelett committed Jun 28, 2020
1 parent 90ef1b3 commit b256542
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ jobs:
run: ./build test+only --configuration=${{ matrix.configuration }}

- name: Send Discord Notification
if: ${{ secrets.DISCORD_WEBHOOK && failure() }}
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
if: ${{ env.DISCORD_WEBHOOK && failure() }}
run: |
git clone --depth 1 https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,17 @@ jobs:
run: xvfb-run ./build test+only --configuration=Release --where="Category!=FlakyNetwork"

- name: Generate Docker image and publish to Hub
if: ${{ secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_PASSWORD && secrets.AWS_ACCESS_KEY_ID && secrets.AWS_SECRET_ACCESS_KEY }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
if: ${{ env.DOCKERHUB_USERNAME && env.DOCKERHUB_PASSWORD && env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY }}
run: |
echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
./build docker-inflator
- name: Push to S3
if: ${{ secrets.AWS_ACCESS_KEY_ID && secrets.AWS_SECRET_ACCESS_KEY }}
# Send ckan.exe and netkan.exe to https://ksp-ckan.s3-us-west-2.amazonaws.com/
uses: jakejarvis/s3-sync-action@master
with:
Expand All @@ -63,14 +62,15 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1
SOURCE_DIR: _build/repack/Release
if: ${{ env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY }}

- name: Send Discord Notification
if: ${{ secrets.DISCORD_WEBHOOK }}
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
if: ${{ env.DISCORD_WEBHOOK }}
run: |
git clone --depth 1 https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ jobs:
asset_content_type: application/vnd.microsoft.portable-executable

- name: Send Discord Notification
if: ${{ secrets.DISCORD_WEBHOOK }}
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
if: ${{ env.DISCORD_WEBHOOK }}]
run: |
git clone --depth 1 https://github.com/DiscordHooks/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL

0 comments on commit b256542

Please sign in to comment.