Skip to content

Commit

Permalink
Merge pull request #45 from JacekZubielik/dev-release-2
Browse files Browse the repository at this point in the history
Release update
  • Loading branch information
JacekZubielik authored May 17, 2024
2 parents b21c939 + 659ef51 commit 5b6d2f1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 97 deletions.
23 changes: 2 additions & 21 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:

pull_request:
branches: [main,issue-*,dev-*]
types:
- closed

workflow_dispatch:

Expand All @@ -25,12 +27,6 @@ jobs:
with:
fetch-depth: 0

# - name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v3
with:
Expand All @@ -44,25 +40,10 @@ jobs:
with:
images: |
ghcr.io/jacekzubielik/node-app
# gorabbit/node-app
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=ref,event=tag
type=ref,event=branch
type=ref,event=pr
# - name: Docker meta
# id: meta
# uses: docker/metadata-action@v5
# with:
# images: |
# ghcr.io/jacekzubielik/node-app
# # gorabbit/node-app
# tags: |
# type=semver,pattern={{version}}
# type=ref,event=branch
# type=ref,event=pr
# env:
# DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index,manifest-descriptor,index-descriptor

Expand Down
77 changes: 3 additions & 74 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
name: Release

on:
push:
tags:
- v[0-9]+.*
# push:
# tags:
# - v[0-9]+.*
pull_request:
branches: [main]
types:
Expand Down Expand Up @@ -63,74 +63,3 @@ jobs:
body: ${{ steps.changelog.outputs.changelog }}
files: |
./CHANGELOG.md
# image:
# runs-on: [self-hosted]
# # needs: [release]

# permissions:
# contents: write
# packages: write

# steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

# - name: Login to DockerHub
# uses: docker/login-action@v3
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/jacekzubielik/node-app
# gorabbit/node-app
tags: |
type=semver,pattern={{version}}
type=ref,enable=true,event=tag
# type=ref,event=branch
# type=ref,event=pr
# type=sha
# type=schedule
# env:
# DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index,manifest-descriptor,index-descriptor
flavor: |
latest=auto
prefix=v
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push
id: push
uses: docker/build-push-action@v5
with:
context: .
tags: ${{ steps.meta.outputs.tags }}
annotations: ${{ steps.meta.outputs.annotations }}
platforms: linux/amd64
labels: ${{ steps.meta.outputs.labels }}
push: true
outputs: |
type=image,name=target
# - name: Docker Hub Description
# uses: peter-evans/dockerhub-description@v4
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# repository: gorabbit/node-app
# readme-filepath: ./README.md
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM node:alpine

ENTRYPOINT ["echo", "Hello from ${{ github.repository }}!"]

LABEL org.opencontainers.image.authors="JacekZubielik" \
org.opencontainers.image.description="node-app" \
org.opencontainers.image.description="Node-app." \
org.opencontainers.image.source="https://github.com/jacekzubielik/node-app"


WORKDIR /app

COPY package.json .
Expand Down

0 comments on commit 5b6d2f1

Please sign in to comment.