diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 1dbd496..ab5c40f 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,11 +13,21 @@ jobs: steps: - uses: actions/checkout@v3 + # Extract version from project.toml + - name: Extract version from project.toml + id: project_version + run: echo "::set-output name=VERSION::$(sed -n 's/^version = \"\([^\"]*\)\"/\1/p' Project.toml)" + + # Extract app name from project.toml + - name: Extract app name from project.toml + id: project_name + run: echo "::set-output name=APP_NAME::$(sed -n 's/^imgname = \"\([^\"]*\)\"/\1/p' Project.toml)" + - name: Build the Docker image - run: docker build . --file Dockerfile --tag pjgim/forecast + run: docker build . --file Dockerfile --tag pjgim/${{ steps.project_name.outputs.APP_NAME }}:${{ steps.project_version.outputs.VERSION }} - name: Log in to Docker Hub run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_HUB_USERNAME }}" --password-stdin - name: Push Docker image - run: docker push pjgim/forecast + run: docker push pjgim/${{ steps.project_name.outputs.APP_NAME }}:${{ steps.project_version.outputs.VERSION }} diff --git a/Project.toml b/Project.toml index 3d90b96..69a324a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,3 +1,6 @@ +name = "SeriesForecast" +imgname = "forecast" +version = "0.0.1" [deps] BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"