Skip to content

Update docker-image.yml #5

Update docker-image.yml

Update docker-image.yml #5

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to the Docker registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
- name: Push the Docker image to the registry
run: docker tag my-image-name:$(date +%s) my-docker-repo/my-image-name:latest
run: docker push my-docker-repo/my-image-name:latest

Check failure on line 23 in .github/workflows/docker-image.yml

View workflow run for this annotation

GitHub Actions / Docker Image CI

Invalid workflow file

The workflow is not valid. .github/workflows/docker-image.yml (Line: 23, Col: 7): 'run' is already defined
# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Pull and run the Docker image
run: |
docker pull my-docker-repo/my-image-name:latest
docker run -d -p 8090:8090 my-docker-repo/my-image-name:latest