action test #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push to Artifact Registry | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
.github/workflows/ship-test-api-image.yml | |
env: | |
VERSION: 1.0.0 | |
TAR_NAME: sdk-test-runner-latest.tar | |
PROJECT_ID: fake-app-323017 | |
REGION: northamerica-northeast1 | |
GAR_LOCATION: northamerica-northeast1-docker.pkg.dev/fake-app-323017/repo-1/ | |
jobs: | |
build-and-upload: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: "package-testing/sdk-test-runner" | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v3 | |
# Set up gCloud | |
- id: "auth" | |
uses: "google-github-actions/auth@v1" | |
with: | |
credentials_json: "${{ secrets.SERVICE_ACCOUNT_KEY }}" | |
- name: "Set up Cloud SDK" | |
uses: "google-github-actions/setup-gcloud@v1" | |
- name: "Use gcloud CLI" | |
run: "gcloud info" | |
# Allow docker access to the GAR | |
- name: "Docker auth" | |
run: |- | |
gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet | |
# Build and push | |
- name: Build and export | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
context: ./package-testing/sdk-test-runner | |
tags: Eppo-exp/sdk-test-runner:latest,Eppo-exp/sdk-test-runner:${{ env.VERSION }} | |
# outputs: type=docker,dest=/tmp/sdk-test-runner.tar | |
# - name: Build image | |
# run: docker build . --file DOCKERFILE_LOCATION --tag ${{ env.GAR_LOCATION }} | |
# working-directory: WORKING_DIRECTORY | |
# - name: Push image | |
# run: docker push ${{ env.GAR_LOCATION }} | |
# - name: Set up Docker Buildx | |
# uses: docker/setup-buildx-action@v3 | |
# - name: Build and export | |
# uses: docker/build-push-action@v6 | |
# with: | |
# context: ./package-testing/sdk-test-runner | |
# tags: Eppo-exp/sdk-test-runner:latest,Eppo-exp/sdk-test-runner:${{ env.VERSION }} | |
# outputs: type=docker,dest=/tmp/sdk-test-runner.tar | |
# - name: Upload artifact | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: sdk-test-runner-image | |
# path: /tmp/sdk-test-runner.tar | |
# - name: Build | |
# run: | | |
# pwd | |
# docker build . -t Eppo-exp/sdk-test-runner:${VERSION} | |
# docker build | |
# with: | |
# tags: Eppo-exp/sdk-test-runner:latest,Eppo-exp/sdk-test-runner:${{ env.VERSION }} | |
# outputs: type=docker,dest=/tmp/${{ env.TAR_NAME }} | |
# - name: Upload artifact | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: sdk-test-runner | |
# path: /tmp/${{ env.TAR_NAME}} | |
# use: | |
# runs-on: ubuntu-latest | |
# needs: build | |
# steps: | |
# - name: Download artifact | |
# uses: actions/download-artifact@v4 | |
# with: | |
# name: sdk-test-runner | |
# path: /tmp | |
# - name: Load image | |
# run: | | |
# docker load --input /tmp/${{ env.TAR_NAME}} | |
# docker image ls -a |