https://github.com/mark-hartmann/update-deployment-action
Action for updating tags for docker images in Kubernetes-deployments
https://github.com/mark-hartmann/update-deployment-action
Last synced: 3 months ago
JSON representation
Action for updating tags for docker images in Kubernetes-deployments
- Host: GitHub
- URL: https://github.com/mark-hartmann/update-deployment-action
- Owner: mark-hartmann
- License: mit
- Created: 2020-10-18T13:13:54.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2020-10-29T18:34:41.000Z (over 4 years ago)
- Last Synced: 2025-01-06T06:16:03.282Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 146 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# update-deployment-action
A simple action for automatically updating docker tags in a Kubernetes deployment within a workflow.
What is it good for? Well, I have tried to find a solution for the deplyoment of multi-repository microservices, which allows the automatic replication of new releases by the services telling the master-repository about a new release per event. are there already better and more sophisticated options? Probably.
# Usage
When using this action three parameters are passed:| Input | Required | Description |
| :----------- |:-------------:| :----- |
| tag | true | The image release/tag you want to deploy |
| name | true | The name of the container (in the k8s deployment, not the image name) you want to apply the tag to |
| deployment | true | the path to the deployment yaml file |**Important**: the name refers to the name an image was given, not the name of the actual image!
``` yaml
...
...
spec:
containers:
- name: # this is what you pass as name
image: /:
```
---
**Example**: A service repository triggers an event named new-release when creating a tag:``` yaml
name: generic workflow
on:
repository_dispatch:
types: [new-release]
jobs:
updateDeployment:
runs-on: ubuntu-latest
steps:
- name: Checkout master-repository
uses: actions/checkout@v2
- name: Apply the new tag to the image
uses: mark-hartmann/update-deployment-action@develop
with:
tag: ${{ github.event.client_payload.ref }} # refs/tags/ gets automatically removed
name: name-of-deployment
deployment: generic-deployment.yaml
```## Attention
This action commits no changes! Due to flexibility, the change must be committed by the user himself. For example, you could use [this action](https://github.com/ad-m/github-push-action "github-push-action").