Skip to content

NPM and Docker Workflow #83

NPM and Docker Workflow

NPM and Docker Workflow #83

version: 2

Check failure on line 1 in .github/workflows/npm-docker-workflow.yml

View workflow run for this annotation

GitHub Actions / NPM and Docker Workflow

Invalid workflow file

The workflow is not valid. .github/workflows/npm-docker-workflow.yml (Line: 1, Col: 1): Unexpected value 'version'
name: NPM and Docker Workflow
on:
push:
branches:
- main
paths:
- '**.yml' # Trigger on changes to workflow files
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