Skip to content

Commit

Permalink
updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
PGimenez committed Feb 2, 2024
1 parent c0489e6 commit 9b34c0b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 9b34c0b

Please sign in to comment.