generated from devopsacademyau/projects-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f032ad
commit 5250d51
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Raghu Github Actions C05-02 | ||
on: | ||
pull_request: | ||
paths: | ||
- "raghunadhpokkalath/c05-actions02/**" | ||
jobs: | ||
dockerbuildandpush: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: "Setup - Checkout" | ||
uses: actions/[email protected] | ||
- name: "Docker Build and Push" | ||
run: | | ||
echo "list folder" | ||
ls | ||
cd raghunadhpokkkalath | ||
make build | ||
DOCKER_PAT=${{ secrets.RAGHU_DOCKER_PAT }} make push | ||
uses: mshick/add-pr-comment@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RAGHU_PAT }} | ||
with: | ||
message: | | ||
Well done ${{ secrets.RAGHU_NAME }}! This is a nice PRN | ||
allow-repeats: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM httpd:2.4.41 | ||
RUN echo "This is my GH actions exercise" > /usr/local/apache2/htdocs/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
SHA=$(shell git rev-parse --short HEAD) | ||
DOCKER_USER=raghunadhp | ||
.PHONY: build | ||
build: | ||
docker build -t ${DOCKER_USER}/my-image:${SHA} . | ||
.PHONY: push | ||
push: | ||
docker login --username ${DOCKER_USER} -p ${DOCKER_PAT} | ||
#0194da5c-e466-4e7f-970f-bed28f7fa39a | ||
docker push raghunadhp/my-image:${SHA} |