Skip to content

Commit

Permalink
refractor: comments and docs. (#38)
Browse files Browse the repository at this point in the history
---
  • Loading branch information
offensive-vk authored Dec 30, 2024
1 parent eecd59c commit 1338b53
Show file tree
Hide file tree
Showing 7 changed files with 298 additions and 377 deletions.
69 changes: 8 additions & 61 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,14 @@ on:
push:
tags:
- '*'
schedule:
- cron: '0 0 * * 0'
workflow_dispatch:

env:
USERNAME: ${{ github.repository_owner }}
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

name: Deploy
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to the Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}

- name: Extract Metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=pr
type=edge
latest
${{ github.ref_name }}
labels: |
org.opencontainers.image.title=auto-issue
org.opencontainers.image.description=Create an Issue using this Action.
org.opencontainers.image.vendor=Vedansh
- name: Verify Tags and Labels
run: |
echo "## Github Action Summary - Docker CI " >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.tags }} " >> $GITHUB_STEP_SUMMARY
- name: Build and Push Image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
call-ghcr-workflow:
uses: offensive-vk/Assets/.github/workflows/ghcr.yml@master
with:
author: "Vedansh"
title: "auto-issue"
description: "Github Action to Create Issue using Octokit and GH CLI."
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI / Test
name: CI / Test Action

on:
push:
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
uses: ./
with:
github-token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
title: "Automated Pull Request from: ${{ github.head_ref }}"
title: "Automated Pull Request from: ${{ github.ref_name }}"
body: |
The `auto-issue` Action is functional locally here.
Expand Down Expand Up @@ -71,10 +71,10 @@ jobs:
uses: ./
with:
github-token: ${{ secrets.BOT_TOKEN || secrets.GITHUB_TOKEN }}
title: "Automated Pull Request from: ${{ github.head_ref }}"
title: Test Issue - `auto-issue` is working fine.
body: |
The `auto-issue` Action is functional locally here.
Good Day!
Good Day !
labels: test,automated
assignees: TheHamsterBot
21 changes: 2 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
FROM node:20

# Install pnpm globally
RUN npm i -g [email protected]

WORKDIR /app

# Copy only package files to install dependencies
COPY package*.json ./

# Install dependencies using pnpm
RUN pnpm i

# Copy the source code to the container
COPY . .

# Build the project, ensuring it compiles to the dist directory
RUN pnpm run build || exit 1

# Check if dist/index.js exists and list files in the dist directory
RUN ls -al dist || echo "dist/ directory not found"

# Start the application with a relative path
ENTRYPOINT ["node", "dist/index.js"]

# Labels
LABEL \
"name"="Auto Issue Action" \
"name"="Auto Issue" \
"homepage"="https://github.com/marketplace/actions/auto-issue" \
"repository"="https://github.com/offensive-vk/auto-issue" \
"maintainer"="TheHamsterBot <[email protected]>"
"maintainer"="TheHamsterBot <[email protected]>"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 - Present. Vedansh <https://github.com/offensive-vk>
Copyright (c) 2024 - Present. Vedansh <superuser.ntsystems@outlook.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 1338b53

Please sign in to comment.