Skip to content

update .gitignore

update .gitignore #9

Workflow file for this run

name: Docker Image Deploy
on:
push:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set date tag
run: echo "DATE_TAG=$(date +%s)" >> $GITHUB_ENV
- name: Build the Docker image
run: |
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/todo-api:${{ env.DATE_TAG }} .
- name: Tag the Docker image
run: |
# Tag with timestamp
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/todo-api:${{ env.DATE_TAG }} ${{ secrets.DOCKERHUB_USERNAME }}/todo-api:${{ env.DATE_TAG }}
# Tag as latest
docker tag ${{ secrets.DOCKERHUB_USERNAME }}/todo-api:${{ env.DATE_TAG }} ${{ secrets.DOCKERHUB_USERNAME }}/todo-api:latest
- name: Push the Docker image
run: |
docker push ${{ secrets.DOCKERHUB_USERNAME }}/todo-api:${{ env.DATE_TAG }}
docker push ${{ secrets.DOCKERHUB_USERNAME }}/todo-api:latest