# in this workflow we don't run the tests. Only build image, tag (also latests) and upload. The tests are not run because they are run # on each pull request, and there is a branch protection that forces to have branch up to date before merging, so tests are always run # with the latest code name: master build image on: push: branches: - master env: GCLOUD_VERSION: '306.0.0' ARTIFACTS_PROJECT_ID: cartodb-on-gcp-main-artifacts jobs: build-master: runs-on: ubuntu-18.04 timeout-minutes: 15 steps: - uses: actions/checkout@v2 with: submodules: true token: ${{ secrets.CARTOFANTE_PERSONAL_TOKEN }} - name: Build image run: | echo ${GITHUB_SHA::7} echo ${GITHUB_REF##*/} docker build -f private/Dockerfile --label="org.opencontainers.image.created=$(date --rfc-3339=seconds)" --label=org.opencontainers.image.revision=${GITHUB_SHA} -t gcr.io/$ARTIFACTS_PROJECT_ID/sql-api:latest -t gcr.io/$ARTIFACTS_PROJECT_ID/sql-api:${GITHUB_REF##*/} -t gcr.io/$ARTIFACTS_PROJECT_ID/sql-api:${GITHUB_SHA::7} -t gcr.io/$ARTIFACTS_PROJECT_ID/sql-api:${GITHUB_REF##*/}--${GITHUB_SHA::7} . docker build -f private/Dockerfile.onprem --label="org.opencontainers.image.created=$(date --rfc-3339=seconds)" --label=org.opencontainers.image.revision=${GITHUB_SHA} -t gcr.io/$ARTIFACTS_PROJECT_ID/sql-api-onprem:latest -t gcr.io/$ARTIFACTS_PROJECT_ID/sql-api-onprem:${GITHUB_REF##*/} -t gcr.io/$ARTIFACTS_PROJECT_ID/sql-api-onprem:${GITHUB_SHA::7} -t gcr.io/$ARTIFACTS_PROJECT_ID/sql-api-onprem:${GITHUB_REF##*/}--${GITHUB_SHA::7} . - uses: google-github-actions/auth@v0 with: credentials_json: ${{ secrets.ARTIFACTS_GCLOUD_ACCOUNT_BASE64 }} - name: Setup gcloud authentication uses: google-github-actions/setup-gcloud@v0 with: version: ${{env.GCLOUD_VERSION}} - name: Configure docker run: gcloud auth configure-docker - name: Upload image run: | docker push gcr.io/$ARTIFACTS_PROJECT_ID/sql-api:${GITHUB_REF##*/} docker push gcr.io/$ARTIFACTS_PROJECT_ID/sql-api:${GITHUB_SHA::7} docker push gcr.io/$ARTIFACTS_PROJECT_ID/sql-api:${GITHUB_REF##*/}--${GITHUB_SHA::7} docker push gcr.io/$ARTIFACTS_PROJECT_ID/sql-api:latest docker push gcr.io/$ARTIFACTS_PROJECT_ID/sql-api-onprem:${GITHUB_REF##*/} docker push gcr.io/$ARTIFACTS_PROJECT_ID/sql-api-onprem:${GITHUB_SHA::7} docker push gcr.io/$ARTIFACTS_PROJECT_ID/sql-api-onprem:${GITHUB_REF##*/}--${GITHUB_SHA::7} docker push gcr.io/$ARTIFACTS_PROJECT_ID/sql-api-onprem:latest