Merge pull request #23 from fleetbase/dev-main

updated github ci workflow to publish to dockerhub
This commit is contained in:
Ron
2023-05-29 14:58:50 +08:00
committed by GitHub
4 changed files with 29 additions and 3 deletions

View File

@@ -28,3 +28,29 @@ jobs:
- name: Build and Start Docker Services
run: |
docker-compose up -d --build
publish:
if: startsWith(github.ref, 'refs/tags/')
name: Push Docker image to Docker Hub
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: your-dockerhub-username/your-repo-name:${{ steps.get_version.outputs.VERSION }}