Skip to content

Update docker-image.yml #6

Update docker-image.yml

Update docker-image.yml #6

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
run: echo "${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}" | docker login -u "${{ secrets.DOCKER_HUB_USER_NAME }}" --password-stdin
- name: Build the Docker image
run: docker build . --file Mostlylucid/Dockerfile --tag ${{ secrets.DOCKER_HUB_USER_NAME }}/mostlylucid:latest
- name: Tag the Docker image with a timestamp
run: docker tag ${{ secrets.DOCKER_HUB_USER_NAME }}/mostlylucid:latest ${{ secrets.DOCKER_HUB_USER_NAME }}/mostlylucid:$(date +%s)
- name: Push the Docker image to Docker Hub
run: |
docker push ${{ secrets.DOCKER_HUB_USER_NAME }}/mostlylucid:latest
docker push ${{ secrets.DOCKER_HUB_USER_NAME }}/mostlylucid:$(date +%s)