diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 8158139..893f1f6 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -19,13 +19,14 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - + - name: Set env + run: echo "TAGS=kintohub/kinto-dashboard:${GITHUB_SHA},kintohub/kinto-dashboard:latest" >> $GITHUB_ENV - name: Build and push id: docker_build uses: docker/build-push-action@v2 with: push: true - tags: kintohub/kinto-dashboard:latest + tags: ${{ env.TAGS }} - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }} \ No newline at end of file diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml new file mode 100644 index 0000000..eb0c91a --- /dev/null +++ b/.github/workflows/tag.yml @@ -0,0 +1,26 @@ +name: Tag Image + +on: + push: + tags: + - 'v*.*.*' + +jobs: + tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set env + run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Checkout + uses: actions/checkout@v2 + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Tag Image + uses: kintoproj/kinto-github-actions/tag-docker-image@v1.1 + with: + from_tag: kintohub/kinto-dashboard:${{ github.sha }} + to_tag: kintohub/kinto-dashboard:${{ env.RELEASE_VERSION }}