Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/1
Browse files Browse the repository at this point in the history
  • Loading branch information
black-da-bull committed Jun 22, 2024
2 parents a46a3cb + 0c2bd5f commit f7b9b01
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

# .github/dependabot.yml
version: 2
name: NPM and Docker Workflow

updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "monthly"
time: "01:00"
commit-message:
prefix: "npm"
groups:
all:
patterns:
- "*"
on:
push:
branches:
Expand Down Expand Up @@ -48,4 +61,4 @@ jobs:

# Step 6: Push image to Docker Hub
- name: Push image to Docker Hub
run: docker push gpt-crawler
run: docker push gpt-crawler
20 changes: 20 additions & 0 deletions .github/workflows/dependabot-automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Dependabot Automerge - Action'
on:
pull_request:
types:
- opened
# Set the access for individual scopes, or use permissions: write-all
permissions:
pull-requests: write
issues: write
repository-projects: write
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Automerge PR
uses: pascalgn/automerge-action@v0.14.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
45 changes: 45 additions & 0 deletions .github/workflows/npm-docker-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version 2
name: NPM and Docker Workflow

on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' # Daily schedule (adjust as needed)

jobs:
update-npm-and-docker:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

# Step 1: Update npm packages and lockfile
- name: Update npm dependencies
run: npm install

# Step 2: Address Dependabot security alerts
- name: Dependabot
uses: dependabot/dependabot-core@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# Step 3: Build Docker image
- name: Build Docker image
run: docker build -t gpt-crawler containerapp

# Step 4: Log in to Docker Hub
- name: Log in to Docker Hub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

# Step 5: Add metadata and labels using docker/metadata-action
- name: Extract metadata
uses: docker/metadata-action@v5
with:
images: gpt-crawler

# Step 6: Push image to Docker Hub
- name: Push image to Docker Hub
run: docker push gpt-crawler

0 comments on commit f7b9b01

Please sign in to comment.