Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marshalldaniel/c05 actions02 #136

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8063b8b
marshalldaniel/c05-actions01
Feb 15, 2022
088fa50
adding workflow
Feb 15, 2022
3bd4b07
marshalldaniel/c05-actions02
Feb 17, 2022
93396e9
marshalldaniel/c05-actions02
Feb 17, 2022
b0ca73f
marshalldaniel/c05-actions02
Feb 17, 2022
984c0bf
marshalldaniel/c05-actions02
Feb 17, 2022
4676eb7
marshalldaniel/c05-actions02
Feb 17, 2022
e3959a3
marshalldaniel/c05-actions02
Feb 17, 2022
661a964
marshalldaniel/c05-actions02
Feb 17, 2022
b49ba9e
marshalldaniel/c05-actions02
Feb 17, 2022
8f4356f
marshalldaniel/c05-actions02
Feb 17, 2022
6001638
marshalldaniel/c05-actions02
Feb 17, 2022
ae6b116
marshalldaniel/c05-actions02
Feb 17, 2022
c347bd1
marshalldaniel/c05-actions02
Feb 17, 2022
73fec42
marshalldaniel/c05-actions02
Feb 17, 2022
f4ac4e6
marshalldaniel/c05-actions02
Feb 17, 2022
ed1c2ca
marshalldaniel/c05-actions02
Feb 17, 2022
d2efb3b
marshalldaniel/c05-actions02
Feb 17, 2022
2b041de
marshalldaniel/c05-actions02
Feb 17, 2022
92a71a0
marshalldaniel/c05-actions02
Feb 17, 2022
2c71775
arshalldaniel/c05-actions02
Feb 17, 2022
57a378e
arshalldaniel/c05-actions02
Feb 17, 2022
1d3c35c
arshalldaniel/c05-actions02
Feb 17, 2022
8d2610c
marshalldaniel/c05-actions02
Feb 17, 2022
0252290
marshalldaniel/c05-actions02
Feb 17, 2022
a5a61c6
marshalldaniel/c05-actions02
Feb 17, 2022
23dd434
marshalldaniel/c05-actions02
Feb 17, 2022
c470b35
marshalldaniel/c05-actions02
Feb 17, 2022
009fa1b
marshalldaniel/c05-actions02
Feb 17, 2022
739ccd9
marshalldaniel/c05-actions02
Feb 18, 2022
e0b5097
marshalldaniel/c05-actions02
Feb 18, 2022
68a560b
marshalldaniel/c05-actions02
Feb 18, 2022
d7ce63d
marshalldaniel/c05-actions02
Feb 18, 2022
4a1ae25
marshalldaniel/c05-actions02
Feb 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/marshalldaniel-c05-actions01.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
on:
pull_request:
paths:
- 'marshalldaniel/*'

jobs:
comment_pr:
runs-on: ubuntu-latest
name: Comment on all PRs targeting marshalldaniel/*
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Comment PR
uses: thollander/actions-comment-pull-request@v1

with:
message: 'Well done ${{ secrets.MARSHALLDANIEL_NAME }} ! This is a nice PR.'
GITHUB_TOKEN: ${{ secrets.MARSHALLDANIEL_GHKEY }}
34 changes: 34 additions & 0 deletions .github/workflows/marshalldaniel-c05-actions02.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
pull_request:
paths:
- 'marshalldaniel/*'

jobs:
comment_pr:
runs-on: ubuntu-latest
name: 3m to build, push and comment pr
steps:
- name: Checkout
uses: actions/checkout@v1

- name: login docker hub
env:
MARSHALLDANIEL_DH_TOKEN: ${{ secrets.MARSHALLDANIEL_DH_TOKEN }}
MARSHALLDANIEL_DH_NAME: ${{ secrets.MARSHALLDANIEL_DH_NAME }}
working-directory: marshalldaniel/c05-actions02/
run: make login_dockerhub

- name: build docker image
working-directory: marshalldaniel/c05-actions02/
run: make build_image

- name: push docker image
id: push_image_id
working-directory: marshalldaniel/c05-actions02/
run: make push_image

- name: Comment PR
uses: thollander/actions-comment-pull-request@v1
with:
message: 'Image name ${{ env.FULLIMAGEID }} has been pushed to dockerhub'
GITHUB_TOKEN: ${{ secrets.MARSHALLDANIEL_GHKEY }}
1 change: 1 addition & 0 deletions marshalldaniel/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Empty :)
2 changes: 2 additions & 0 deletions marshalldaniel/c05-actions02/Dockerfile
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
2 changes: 2 additions & 0 deletions marshalldaniel/c05-actions02/Dockerfile.v2
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
20 changes: 20 additions & 0 deletions marshalldaniel/c05-actions02/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export SHORT_COMMIT_SHA = $(shell git rev-parse --short HEAD)
export IMAGE_NAME = marshalldaniel/c05-actions02
export FULL_IMAGE_NAME = "$(IMAGE_NAME):$(SHORT_COMMIT_SHA)"
DOCKER_COMPOSE = docker-compose build
DOCKERHUB_PUSH = docker push $(IMAGE_NAME):$(SHORT_COMMIT_SHA)

all: build_image push_image

.PHONY: build_image
build_image:
$(DOCKER_COMPOSE)

.PHONY: login_dockerhub
login_dockerhub:
@echo $(MARSHALLDANIEL_DH_TOKEN) | docker login -u $(MARSHALLDANIEL_DH_NAME) --password-stdin

.PHONY: push_image
push_image:
$(DOCKERHUB_PUSH)
echo "FULLIMAGEID=$(IMAGE_NAME):$(SHORT_COMMIT_SHA)" >> $(GITHUB_ENV)
5 changes: 5 additions & 0 deletions marshalldaniel/c05-actions02/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: '3.8'
services:
web:
image: ${IMAGE_NAME}:${SHORT_COMMIT_SHA}
build: .