Skip to content

Commit

Permalink
Merge 02d6591 into ae9e521
Browse files Browse the repository at this point in the history
  • Loading branch information
nakamasato authored Sep 16, 2024
2 parents ae9e521 + 02d6591 commit 9de56ce
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: environment
on:
pull_request:
release:
types:
- published
push:
branches:
- main
env:
ENVIRONMENT: ${{ github.event_name == 'release' && 'production' || github.event_name == 'push' && 'development' || github.event_name == 'pull_request' && 'pull_request'

jobs:
run:
runs-on: ubuntu-latest
environment:
name: ${{ github.event_name == 'release' && 'production' || github.event_name == 'push' && 'development' || github.event_name == 'pull_request' && 'pull_request'
steps:
- name: check environment (${{ github.event_name == 'release' && 'production' || github.event_name == 'push' && 'development' || github.event_name == 'pull_request' && 'pull_request' }})
run: |
echo ${{ github.event_name == 'release' && 'production' || github.event_name == 'push' && 'development' || github.event_name == 'pull_request' && 'pull_request' }}
echo "$ENVIRONMENT"
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@

</details>

- [Environment](https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-deployments/managing-environments-for-deployment)
```yaml
environment:
name: ${{ github.event_name == 'release' && 'production' || github.event_name == 'push' && 'development' || github.event_name == 'pull_request' && 'pull_request' }}
```

- [Caching](https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows)

- General: [actions/cache](https://github.com/actions/cache)
Expand Down

0 comments on commit 9de56ce

Please sign in to comment.