This repository has been archived by the owner on Mar 6, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: Synchronize with ergebnis/github-action-template
- Loading branch information
1 parent
48e4e95
commit 8d89aa1
Showing
8 changed files
with
91 additions
and
39 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 |
---|---|---|
@@ -1,10 +1,11 @@ | ||
.build/ | ||
.github/ | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.travis.yml | ||
CHANGELOG.md | ||
LICENSE | ||
Makefile | ||
README.md | ||
/.build/ | ||
/.git/ | ||
/.github/ | ||
/bin/ | ||
/.editorconfig | ||
/.gitattributes | ||
/.gitignore | ||
/CHANGELOG.md | ||
/LICENSE | ||
/Makefile | ||
/README.md |
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
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
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,46 @@ | ||
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- "**" | ||
|
||
name: "Continuous Deployment" | ||
|
||
jobs: | ||
build: | ||
name: "Build and deploy" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
env: | ||
DOCKER_IMAGE: localheinz/composer-normalize-action | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: actions/checkout@v1 | ||
|
||
- name: "Build Docker image" | ||
run: $(which docker) build --tag ${DOCKER_IMAGE}:latest . | ||
|
||
- name: "Docker Login" | ||
if: "'refs/heads/master' == github.ref || startsWith(github.ref, 'refs/tags/')" | ||
run: echo ${{ secrets.DOCKER_PASSWORD }} | $(which docker) login --password-stdin --username ${{ secrets.DOCKER_USERNAME }} | ||
|
||
- name: "Push Docker image (latest)" | ||
if: "'refs/heads/master' == github.ref || startsWith(github.ref, 'refs/tags/')" | ||
run: $(which docker) push ${DOCKER_IMAGE}:latest | ||
|
||
- name: "Tag Docker image (versioned)" | ||
if: "startsWith(github.ref, 'refs/tags/')" | ||
run: $(which docker) tag ${DOCKER_IMAGE} ${DOCKER_IMAGE}:$(bash ./bin/tag-name.sh ${GITHUB_REF}) | ||
|
||
- name: "Push Docker image (versioned)" | ||
if: "startsWith(github.ref, 'refs/tags/')" | ||
run: $(which docker) push ${DOCKER_IMAGE}:$(bash ./bin/tag-name.sh ${GITHUB_REF}) | ||
|
||
- name: "Docker Logout" | ||
if: "'refs/heads/master' == github.ref || startsWith(github.ref, 'refs/tags/')" | ||
run: $(which docker) logout |
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
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
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 |
---|---|---|
@@ -1,10 +1,12 @@ | ||
.PHONY: docker help it | ||
|
||
DOCKER_IMAGE:=ergebnis/github-action-template | ||
|
||
it: docker ## Runs the docker target | ||
|
||
docker: ## Builds, tags, and runs the Docker image | ||
docker build --tag localheinz/composer-normalize-action . | ||
docker run --interactive --rm --tty --workdir=/normalizer --volume ${PWD}/.build:/normalizer localheinz/composer-normalize-action:latest | ||
docker build --tag ${DOCKER_IMAGE} . | ||
docker run --interactive --rm --tty --workdir=/app --volume ${PWD}:/app ${DOCKER_IMAGE}:latest | ||
|
||
help: ## Displays this list of targets with descriptions | ||
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' |
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,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
GITHUB_REF=$1 | ||
|
||
if [[ -n $GITHUB_REF && $GITHUB_REF == refs/tags/* ]]; then | ||
echo "${GITHUB_REF#refs/tags/}"; | ||
|
||
exit 0 | ||
fi | ||
|
||
echo "Unable to determine tag name from '${GITHUB_REF}'" | ||
|
||
exit 1; |