Skip to content
This repository was archived by the owner on Nov 29, 2024. It is now read-only.

Commit e790c1c

Browse files
Merge pull request #9 from GlueOps/chore/cleanup-action
Chore/cleanup action
2 parents 69ade0c + e5a459b commit e790c1c

File tree

2 files changed

+1
-79
lines changed

2 files changed

+1
-79
lines changed

README.md

Lines changed: 1 addition & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -9,70 +9,5 @@ Automate your Docker image deployments effortlessly with this custom GitHub Acti
99
✅ Seamless integration: GitHub Container Registry simplifies container image management.
1010

1111
## 🛠️ How to Use
12-
- In your repository's settings, under the ```Actions``` tab
13-
- Click on ```General```, scroll to the bottom and enable ```Read and write permissions``` for your ```Workflow Permissions```.
14-
- Click ```Save```.
1512

16-
<img width="1143" alt="image" src="https://github.com/Mbaoma/build-image/assets/49791498/92ff77e4-16a9-4798-85bd-3d0ee9a5cb11">
17-
18-
*Actions Tab*
19-
20-
<img width="1143" alt="image" src="https://github.com/Mbaoma/build-image/assets/49791498/6e8d3834-e10f-4cc1-b320-bfe58e1cfed5">
21-
22-
*Permission Update*
23-
24-
- Add this step to your workflow as follows:
25-
```Docker
26-
name: GlueOps Action
27-
28-
on: [push]
29-
30-
jobs:
31-
build_tag_push_to_ghcr:
32-
runs-on: ubuntu-latest
33-
steps:
34-
- name: Build, Tag and Push Docker Image to GHCR
35-
uses: GlueOps/[email protected]
36-
```
37-
38-
## 🔖 Image Tags
39-
Your image is automatically tagged based on the event behind the image creation.
40-
41-
### Image Tagging Scenario: On Push Event 🚀
42-
Whenever a push event occurs in the repository, this workflow automatically assigns relevant tags to your image. The tags include the ```branch slug```, ```short SHA (commit identifier)```, and ```long SHA```, providing valuable context about the image's origin and version.
43-
44-
For example, let's consider a scenario where you have a GitHub repository for a web application called ```MyWebApp```. Whenever a developer pushes changes to the ```develop``` branch, the workflow automatically tags the image with the following details:
45-
46-
| Key | Value |
47-
| --- | --- |
48-
| Branch slug | develop |
49-
| Short SHA | 32b5b6b |
50-
| Long SHA | 32b5b6b7bd6e070f8f176e1423938d66072e6463 |
51-
52-
53-
### Image Tagging Scenario: On Release Event 🚀
54-
Whenever a release event occurs in the repository, the action automatically assigns relevant tags to your image. The tags include the ```release version```, ```short SHA (commit identifier)```, and ```long SHA```, providing valuable context about the image's origin and version.
55-
56-
For example, let's consider a scenario where you have a GitHub repository for a web application called ```MyWebApp```. Whenever a developer creates a new release with version ```v1.0.0```, the action automatically tags the image with the following details:
57-
58-
| Key | Value |
59-
| --- | --- |
60-
| Release version | v1.0.0 |
61-
| Short SHA | 32b5b6b |
62-
| Long SHA | 32b5b6b7bd6e070f8f176e1423938d66072e6463 |
63-
64-
These automated tagging processes ensures that you can easily track and identify specific versions of your application, streamlining your development and deployment workflows.
65-
66-
## 🏳️ Defaults
67-
- Your ```Dockerfile``` has to be in the root directory.
68-
- Your ```docker image``` is named after your repository.
69-
70-
## Pushing to GitHub
71-
```bash
72-
$ git add .
73-
$ git commit -m 'commit-message'
74-
$ git tag -a -m "Description of this release" v0.0.0 (replace with your version tag)
75-
$ git push --follow-tags
76-
```
77-
78-
This workflow is inspired by [macbre's](https://github.com/macbre/push-to-ghcr) work.
13+
For usage instructions, refer to the [GlueOps Documentation](https://glueops.dev/docs/deploy-applications/deploy-hello-world-to-glueops#add-ci-to-publish-a-docker-image-to-github-container-registry).

action.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,6 @@ runs:
7373
echo "::group::Set commit tags"
7474
echo "Event payload: ${{ toJson(github.event_name) }}"
7575
76-
#for release events, the tag name is available as github.event.release.tag_name, long SHA as github.sha and short SHA as github.sha_short
77-
# if [ "${{ github.event_name }}" = "release" ]; then
78-
# export TAG_NAME="${{ github.event.release.tag_name }}"
79-
# export COMMIT_TAG="${TAG_NAME#refs/tags/}"
80-
# export SHA="${{ github.sha }}"
81-
# export SHORT_SHA="${SHA:0:7}"
82-
83-
# echo "Release Version ${COMMIT_TAG}"
84-
# echo "Short SHA ${SHORT_SHA}"
85-
# echo "Long SHA ${SHA}"
86-
87-
# else
8876
#for commits, the tag name is available as github.ref, long SHA as github.sha and short SHA as github.sha_short
8977
if [ -z "${IMAGE_TAG}" ]; then
9078
BRANCH_NAME="${BRANCH_NAME#refs/tags/}"
@@ -104,7 +92,6 @@ runs:
10492
echo "Short SHA ${SHORT_SHA}"
10593
echo "Long SHA ${SHA}"
10694
fi
107-
# fi
10895
10996
# convert the image name to lowercase
11097
export IMAGE_NAME=$(echo "${IMAGE_NAME}" | tr '[:upper:]' '[:lower:]')

0 commit comments

Comments
 (0)