Skip to content

Commit

Permalink
feat: Add workflows for GHCR and releases
Browse files Browse the repository at this point in the history
  • Loading branch information
Pradumnasaraf committed Feb 22, 2023
1 parent 1ee5163 commit a3d311a
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
name: Greeting message
name : Greetings

on:
fork:
push:
branches: [main]
issues:
types: [opened]
issue_comment:
types: [created]
pull_request_target:
types: [opened]

pull_request_review_comment:
types: [created]

jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: EddieHubCommunity/gh-action-community/src/welcome@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.github_token }}
issue-message: "<h3>Hey! contributor, thank you for opening an Issue 🎉.</h3>"
pr-message: "<h3>Hey! contributor, thank you for opening a Pull Request 🎉.</h3>"
footer: "Soon one of our maintainers will review it and provide you with feedback/suggestions. If you think it's something urgent, feel free to reach out <a href='https://twitter.com/home'>Pradumna Saraf</a> on <b>Twitter</b>. Star ⭐ this repo to show us support.</b><br><br><b>Happy, Open Source!</b>"
footer: "Soon one of our maintainers will review it and provide you with feedback/suggestions. If you think it's something urgent, feel free to reach out <a href='https://twitter.com/home'>Pradumna Saraf</a> on <b>Twitter</b>. Star ⭐ this repo to show us support.</b><br><br><b>Happy, Open Source!</b>"
41 changes: 41 additions & 0 deletions .github/workflows/publish-ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish Image to GitHub Container Registry

on:
push:
branches: ["main"]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ghcr.io/pradumnasaraf/go-api:latest
labels: ${{ steps.meta.outputs.labels }}
29 changes: 29 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Releases
on:
push:
branches:
- main

jobs:
changelog:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: conventional Changelog Action
id: changelog
uses: TriPSs/[email protected]
with:
github-token: ${{ secrets.PA_TOKEN }}
version-file: './releases.json'

- name: create release
uses: actions/create-release@v1
if: ${{ steps.changelog.outputs.skipped == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.PA_TOKEN }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}
3 changes: 3 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "0.2.0"
}

0 comments on commit a3d311a

Please sign in to comment.