name: ci on: push: branches: - 'develop' - 'main' jobs: docker: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v2 - name: Get base image name shell: bash run: echo "##[set-output name=image;]$(echo gcr.io/up9-docker-hub/mizu/${GITHUB_REF#refs/heads/})" id: base_image_step - name: Docker meta id: meta uses: crazy-max/ghaction-docker-meta@v2 with: images: ${{ steps.base_image_step.outputs.image }} tags: | type=sha type=raw,${{ github.sha }} type=raw,latest - name: Login to DockerHub uses: docker/login-action@v1 with: registry: gcr.io username: _json_key password: ${{ secrets.GCR_JSON_KEY }} - name: Build and push uses: docker/build-push-action@v2 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}