Skip to content

Commit

Permalink
updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
na4ma4 committed Feb 19, 2024
1 parent c846a92 commit 6a2eec5
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/docker-pr-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,15 @@ on:
required: true
description: "Pull Request Number (github.event.pull_request.number)"
type: string
# pull_request:
# types:
# - closed

jobs:
metadata:
name: "Generate Metadata"
runs-on: ubuntu-latest
outputs:
user-type: ${{steps.userdata.outputs.type}}
version-url: ${{steps.version-url.outputs.url}}
version-id: ${{steps.version-id.outputs.VERSION_ID}}
version-id: ${{steps.version-id.outputs.version_id}}
steps:
- name: Get User Type from API
id: userdata
Expand Down Expand Up @@ -88,11 +86,9 @@ jobs:
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{secrets.GITHUB_TOKEN}}" \
"${{steps.version-url.outputs.url}}" >> ${HOME}/versionIds.json
echo "VERSION_ID=$(jq -r ".[] | select(.metadata.container.tags | index(\"pr-${{ inputs.pull-request-number }}\")).id" ${HOME}/versionIds.json)" | tee -a "${GITHUB_OUTPUT}"
- name: Print Version ID JSON
run: cat ${HOME}/versionIds.json
echo "version_id=$(jq -r ".[] | select(.metadata.container.tags | index(\"pr-${{ inputs.pull-request-number }}\")).id" ${HOME}/versionIds.json)" | tee -a "${GITHUB_OUTPUT}"
- name: Print Version ID
run: echo "The selected Version ID is ${{ steps.version-id.outputs.VERSION_ID }}"
run: echo "The selected Version ID is ${{ steps.version-id.outputs.version_id }}"

# this job will only run if the PR has been merged
merge_job:
Expand Down
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
# actions

GitHub Reusable Actions

## Usage

## Unit Testing

```yaml
name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
unit-test:
name: "Unit Test"
uses: dosquad/actions/.github/workflows/unit-test.yml@main
secrets: inherit
```
### Docker Release
```yaml
name: "Docker Release"

on:
pull_request:
push:
branches:
- main

jobs:
docker:
name: "Docker"
uses: dosquad/actions/.github/workflows/docker-release.yml@main
with:
image: ghcr.io/dosquad/database-operator
platforms: 'linux/amd64,linux/arm64'
latest-on-branch: '{{is_default_branch}}'
secrets: inherit

```

### Docker PR Cleanup

```yaml
name: Cleanup on Closed Pull Request

on:
pull_request:
types:
- closed

jobs:
docker:
name: "Docker Cleanup"
uses: dosquad/actions/.github/workflows/docker-pr-cleanup.yml@main
with:
package-name: database-operator
owner: "${{github.repository_owner}}"
pull-request-merged: "${{github.event.inputs.pull-request-merged}}"
pull-request-number: "${{github.event.pull_request.number}}"
secrets: inherit
```

0 comments on commit 6a2eec5

Please sign in to comment.