Skip to content

Commit

Permalink
Hamster Left A Pull Request - (Updated CI.) (#192)
Browse files Browse the repository at this point in the history
* Updated CI.

* add a ci

* bulk.

---------

Co-authored-by: Vedansh <[email protected]>
  • Loading branch information
TheHamsterBot and offensive-vk authored Oct 11, 2024
1 parent 3944ea7 commit 1954a06
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 49 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/auto-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
create_pr:
runs-on: ubuntu-latest
if: ${{ github.actor != 'dependabot[bot]' && github.event.pusher.name != 'dependabot[bot]' }}

steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -74,4 +73,4 @@ jobs:
gh pr edit "$PR_NUMBER" --body "$MARKDOWN_CONTENT"
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/bulk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Automated Bulk Issue Creator

on:
schedule:
- cron: '0 */1 * * *'
workflow_dispatch:
inputs:
issue_count:
description: 'Number of Issues'
required: true
default: '100'

jobs:
create_issue:
runs-on: ubuntu-latest
name: Workflow Job
steps:
- name: Install GitHub CLI
run: |
sudo apt-get install gh -y
- uses: actions/checkout@v4
- name: Create Issues
run: |
# for i in $(seq 1 ${{ github.event.inputs.issue_count }}); do
for i in $(seq 1 500); do
issue_number=$(gh issue create --title "Automated Issue $i" --body "This is issue $i, created by Hamster [bot]." --label "automated,bot,hamster,issue" --assignee "TheHamsterBot")
echo "Issue #$issue_number created."
sleep 3
gh issue close "$issue_number" --comment "Hamster [bot] - Closed This Issue."
echo "Issue #$issue_number closed."
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47 changes: 32 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Deploy to GitHub Container Registry
name: Deploy to GHCR

on:
schedule:
- cron: '0 0 1 * *'
- cron: '0 0 * * 0'
workflow_dispatch:

env:
Expand All @@ -17,35 +17,52 @@ jobs:
permissions:
contents: read
packages: write


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

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

- name: Extract Docker Metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=pr
type=edge
flavor: |
latest=true
labels: |
org.opencontainers.image.title=Classics
org.opencontainers.image.vendor=Vedansh
org.opencontainers.image.source=https://github.com/offensive-vk/Classics
- name: Login to the Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ env.PASSWORD }}

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

- name: Verify Tags and Labels
run: |
echo "## Github Action Summary - GHCR " >> $GITHUB_STEP_SUMMARY
echo "Tags: ${{ steps.meta.outputs.tags }}" >> $GITHUB_STEP_SUMMARY
echo "Labels: ${{ steps.meta.outputs.labels }} " >> $GITHUB_STEP_SUMMARY
echo "*** VERIFICATION COMPLETED ***" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.tags }} " >> $GITHUB_STEP_SUMMARY
echo "${{ steps.meta.outputs.labels }} " >> $GITHUB_STEP_SUMMARY
echo "*** VERIFICATION COMPLETED ***"
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
uses: docker/build-push-action@e44afff3590e1d4f93b6adc72376512edb012a7c # v5.0.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
19 changes: 19 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Docker

on:
schedule:
- cron: '0 */1 * * *'
push:
branches: [ "classic", "**" ]
pull_request:
branches: [ "classic", "**" ]
workflow_dispatch:

jobs:
build_image:
runs-on: ubuntu-latest
name: Build Image
steps:
- uses: actions/checkout@v4
- name: Build the Docker Image
run: docker build . --file Dockerfile -t classics:$(date +%s)
4 changes: 2 additions & 2 deletions .github/workflows/mirror.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ on:
schedule:
- cron: '0 */2 * * *'
push:
branches: ["*"]
branches: ["**"]
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
timeout-minutes: 10
name: Gitlab Sync
name: Sync
steps:
- uses: actions/checkout@v4
with:
Expand Down
29 changes: 1 addition & 28 deletions .github/workflows/morning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,4 @@ jobs:
run: |
sudo apt update -y; sudo apt install lolcat neofetch -y
neofetch | lolcat
uname -a; whoami; df -T
greetings:
runs-on: macos-latest
timeout-minutes: 5
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup
id: date_time
run: |
echo "DATE=$(date '+%B %d, %Y')" >> $GITHUB_ENV
echo "TIME=$(date '+%I:%M %p')" >> $GITHUB_ENV
- name: Say Good Morning
run: |
echo -e "\n# Good Morning, **General** ! \n\nToday is **${{ env.DATE }}** \n\n *Have a Wonderful Day Ahead.*" > GREETINGS.md
- name: Commit & Push Changes
run: |
git config --global user.name "Hamster [bot]"
git config --global user.email "[email protected]"
git add GREETINGS.md
git commit -m "🤖 Hamster Sends Greeting of the Day."
git push
env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
uname -a; whoami; df -T
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM ubuntu:latest
FROM debian:bullseye

RUN apt-get update && \
apt-get install -y \
build-essential \
cmake \
git \
clang \
libssl-dev \
gcc \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /base
Expand Down

0 comments on commit 1954a06

Please sign in to comment.