Skip to content

Commit

Permalink
Merge pull request #7 from DFE-Digital/gh-actions-release
Browse files Browse the repository at this point in the history
GitHub Actions docs and semver release
  • Loading branch information
pritchyspritch authored Sep 19, 2024
2 parents 0262165 + d73fd07 commit 4222d11
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,15 @@ jobs:
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
- name: Create GitHub Release for pip/python (0.0.0)
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh release create '${{ needs.tag-release-on-push.outputs.new_tag }}' --repo '${{ github.repository }}' --notes ""
run: gh release create '${{ needs.tag-release-on-push.outputs.new_tag }}' --repo '${{ github.repository }}' --generate-notes

- name: Create GitHub Actions Semver Release (v0.0.0)
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh release create 'v${{ needs.tag-release-on-push.outputs.new_tag }}' --repo '${{ github.repository }}' --notes "GitHub Actions semver release"

- name: Upload artifact signatures to GitHub Release
env:
Expand Down
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,68 @@ Options:
$ sap /path/to/app/folder --prod
```

## Use as GitHub Action

### Example production deployment

```yaml
name: Production Deployment

on:
push:
branches:
- main
paths:
- APP_NAME/**
workflow_dispatch:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: dfe-digital/splunk-app-packager@v0.0.2
with:
app_package_path: 'APP_NAME'
splunk_username: ${{ secrets.SPLUNK_USERNAME }}
splunk_password: ${{ secrets.SPLUNK_PASSWORD }}
splunk_acs_token: ${{ secrets.SPLUNK_ACS_TOKEN }}
splunk_acs_stack: ${{ secrets.SPLUNK_ACS_STACK }}
```
### Example with a different path for config.toml
```yaml
name: Production Deployment

on:
push:
branches:
- main
paths:
- APP_NAME/**
workflow_dispatch:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: dfe-digital/splunk-app-packager@v0.0.2
with:
app_package_path: 'APP_NAME'
splunk_username: ${{ secrets.SPLUNK_USERNAME }}
splunk_password: ${{ secrets.SPLUNK_PASSWORD }}
splunk_acs_token: ${{ secrets.SPLUNK_ACS_TOKEN }}
splunk_acs_stack: ${{ secrets.SPLUNK_ACS_STACK }}
config_toml_path: 'conf/config.toml'
```
## Contributing
Refer to [our contributing guidelines](.github/CONTRIBUTING.md) if you'd like to raise a bug or pull request.

0 comments on commit 4222d11

Please sign in to comment.