diff --git a/.github/workflows/dockerpush.yml b/.github/workflows/dockerpush.yml index d8dcf89..d1eb98d 100644 --- a/.github/workflows/dockerpush.yml +++ b/.github/workflows/dockerpush.yml @@ -1,11 +1,18 @@ name: Create geosupport docker image on: [push] jobs: + skip: + name: Build and test + runs-on: ubuntu-latest + if: "! contains(github.event.head_commit.message, '[skip ci]')" + steps: + - run: echo "${{ github.event.head_commit.message }}" push: + needs: skip runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Log into registry + - name: Log into Github registry run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin - name: Build image shell: bash @@ -20,5 +27,23 @@ jobs: --build-arg PATCH=$PATCH \ --tag docker.pkg.github.com/nycplanning/docker-geosupport/geosupport:${VERSION} . docker push docker.pkg.github.com/nycplanning/docker-geosupport/geosupport:${VERSION} - docker tag docker.pkg.github.com/nycplanning/docker-geosupport/geosupport:${VERSION} docker.pkg.github.com/nycplanning/docker-geosupport/geosupport:latest + - name: Push image + shell: bash + run: | + export $(echo '${{ github.event.head_commit.message }}' | sed 's/#.*//g' | xargs) + export VERSION=$MAJOR.$MINOR.$PATCH + docker tag docker.pkg.github.com/nycplanning/docker-geosupport/geosupport:${VERSION} \ + docker.pkg.github.com/nycplanning/docker-geosupport/geosupport:latest docker push docker.pkg.github.com/nycplanning/docker-geosupport/geosupport:latest + - name: Log into Docker registry + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin + - name: Update Dockerhub + shell: bash + run: | + export $(echo '${{ github.event.head_commit.message }}' | sed 's/#.*//g' | xargs) + export VERSION=$MAJOR.$MINOR.$PATCH + docker tag docker.pkg.github.com/nycplanning/docker-geosupport/geosupport:${VERSION} \ + sptkl/docker-geosupport:${VERSION} + docker push sptkl/docker-geosupport:${VERSION} + docker tag sptkl/docker-geosupport:${VERSION} sptkl/docker-geosupport:latest + docker push sptkl/docker-geosupport:latest