diff --git a/.github/workflows/docker-build-dev.yml b/.github/workflows/docker-build-dev.yml index 2c7bd04..4ae55a8 100644 --- a/.github/workflows/docker-build-dev.yml +++ b/.github/workflows/docker-build-dev.yml @@ -15,6 +15,12 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: + id: vars + shell: bash + run: | + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + - name: Login to DockerHub if: github.event_name != 'pull_request' uses: docker/login-action@v1 @@ -27,4 +33,4 @@ jobs: with: context: . push: true - tags: deltampc/delta-contracts:dev + tags: deltampc/delta-contracts:dev-${{ steps.vars.outputs.sha_short }} diff --git a/.github/workflows/docker-build-manually.yml b/.github/workflows/docker-build-manually.yml new file mode 100644 index 0000000..7c27efc --- /dev/null +++ b/.github/workflows/docker-build-manually.yml @@ -0,0 +1,37 @@ +name: build docker image dev manually +on: + workflow_dispatch: + inputs: + name: + description: 'build manually trigger' + required: true + default: 'triggered by developer' + home: + description: 'location' + required: false + default: 'The developer team' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: + id: vars + shell: bash + run: | + echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" + - name: Login to DockerHub + if: github.event_name != 'pull_request' + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Docker build and push + uses: docker/build-push-action@v2 + with: + context: . + push: true + tags: deltampc/delta-contracts:dev-${{ steps.vars.outputs.sha_short }}