Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtARTs36 committed Dec 20, 2024
1 parent 27b997f commit 5e6a9e1
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
# edit-config

edit-config - is console app and GitHub action for editing configuration files

## Usage

### Release workflow with up image version in GitHub action.yaml

```yaml
name: release

permissions: write-all

on:
workflow_dispatch:
inputs:
version:
description: version
required: true
type: choice
options:
- major
- minor
- patch

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4 # action page: <https://github.com/actions/setup-go>
with:
go-version: stable

- name: Generate next version
id: version
uses: ci-space/edit-config@master
with:
file: action.yaml
action: up-image-version
pointer: runs.image
value: ${{ github.event.inputs.version }}

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image
uses: docker/build-push-action@v4 # Action page: <https://github.com/docker/build-push-action>
with:
context: .
file: Dockerfile
push: true
platforms: linux/amd64
tags: |
ghcr.io/ci-space/edit-config:${{ steps.version.outputs.new-version }}
- name: Commit changes
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git add action.yaml
git commit -m "chore: update image version ${{ steps.version.outputs.new-version }} in action.yaml"
git push
- name: Create Tag
uses: negz/create-tag@v1
with:
version: ${{ steps.version.outputs.new-version }}
message: ''
token: ${{ secrets.GITHUB_TOKEN }}
```

0 comments on commit 5e6a9e1

Please sign in to comment.