Skip to content

Merge pull request #8 from XLsoft-Corporation/master #17

Merge pull request #8 from XLsoft-Corporation/master

Merge pull request #8 from XLsoft-Corporation/master #17

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Docker image
run: docker build . --file Dockerfile --tag ${{ vars.DOCKERHUB_IMAGE_NAME }}:$(date +%Y%m%d)
- name: Push the Docker image
run: docker push ${{ vars.DOCKERHUB_IMAGE_NAME }}:$(date +%Y%m%d)
- name: Push the Docker image with latest tag
run: docker tag ${{ vars.DOCKERHUB_IMAGE_NAME }}:$(date +%Y%m%d) ${{ vars.DOCKERHUB_IMAGE_NAME }}:latest && docker push ${{ vars.DOCKERHUB_IMAGE_NAME }}:latest