-
Notifications
You must be signed in to change notification settings - Fork 382
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
Showing
8 changed files
with
133 additions
and
27 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,10 @@ | ||
#Ignore logs | ||
logs/ | ||
*.log | ||
|
||
#Ignore the git and cache folders | ||
.git | ||
.cache | ||
|
||
#Ignore Temp files | ||
*.tmp |
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,77 @@ | ||
name: Build & Publish Docker Image | ||
|
||
# This workflow builds the prebuild.Dockerfile and publishes the image to the GitHub Container Registry if the build is successful. | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
packages: write | ||
contents: read | ||
|
||
env: | ||
IMAGE_NAME: ${{ github.repository }} | ||
IMAGE_TAG: ${{ github.sha }} | ||
REGISTRY: ghcr.io | ||
|
||
jobs: | ||
build: | ||
timeout-minutes: 15 | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Generate Docker Metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
images: | | ||
${{ env.IMAGE_NAME }} | ||
ghcr.io/user${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
- name: Set up QEMU To support build amd64 and arm64 images | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
id: docker_build | ||
with: | ||
push: ${{ github.event_name != 'pull_request' }} | ||
context: . | ||
file: ./prebuild.Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
|
||
- name: Output image, digest and metadata to summary | ||
run: | | ||
{ | ||
echo imageid: "${{ steps.docker_build.outputs.imageid }}" | ||
echo digest: "${{ steps.docker_build.outputs.digest }}" | ||
echo labels: "${{ steps.meta.outputs.labels }}" | ||
echo tags: "${{ steps.meta.outputs.tags }}" | ||
echo version: "${{ steps.meta.outputs.version }}" | ||
} >> "$GITHUB_STEP_SUMMARY" |
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
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,8 @@ | ||
FROM node:16-alpine | ||
LABEL "repository"="https://github.com/anothrNick/github-tag-action" | ||
LABEL "homepage"="https://github.com/anothrNick/github-tag-action" | ||
LABEL "maintainer"="Nick Sjostrom" | ||
|
||
RUN apk --no-cache add bash git curl jq && npm install -g semver | ||
# hadolint ignore=DL3007 | ||
FROM ghcr.io/anothrnick/github-tag-action:latest | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
LABEL "repository"="https://github.com/anothrnick/github-tag-action" | ||
LABEL "homepage"="https://github.com/anothrnick/github-tag-action" | ||
LABEL "maintainer"="Nick Sjostrom" | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] | ||
# This Dockerfile is empty, it simply pulls a prebuilt image to speed up the Action. |
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,16 +1,16 @@ | ||
name: 'Github Tag Bump' | ||
description: 'Bump and push git tag on merge' | ||
author: 'Nick Sjostrom' | ||
name: "Github Tag Bump" | ||
description: "Bump and push git tag on merge" | ||
author: "Nick Sjostrom" | ||
runs: | ||
using: 'docker' | ||
image: 'Dockerfile' | ||
using: "docker" | ||
image: "Dockerfile" | ||
outputs: | ||
new_tag: | ||
description: 'Generated tag' | ||
description: "Generated tag" | ||
tag: | ||
description: 'The latest tag after running this action' | ||
description: "The latest tag after running this action" | ||
part: | ||
description: 'The part of version which was bumped' | ||
description: "The part of version which was bumped" | ||
branding: | ||
icon: 'git-merge' | ||
color: 'purple' | ||
icon: "git-merge" | ||
color: "purple" |
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,12 @@ | ||
FROM node:16-alpine | ||
|
||
LABEL "repository"="https://github.com/anothrnick/github-tag-action" | ||
LABEL "homepage"="https://github.com/anothrnick/github-tag-action" | ||
LABEL "maintainer"="Nick Sjostrom" | ||
|
||
# hadolint ignore=DL3016,DL3018 | ||
RUN apk --no-cache add bash git curl jq && npm install -g semver | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |