From 8aa2ee98f02e04b942914436f2112fabaf1d6b08 Mon Sep 17 00:00:00 2001 From: Patrick Date: Thu, 13 Jul 2023 12:59:54 -0700 Subject: [PATCH] change build push to github isntead of gcp --- .github/workflows/push_image.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/push_image.yml b/.github/workflows/push_image.yml index 38b2a26..6435581 100644 --- a/.github/workflows/push_image.yml +++ b/.github/workflows/push_image.yml @@ -1,30 +1,32 @@ ---- name: Create and publish a Docker image on: push: + branches: env: - REGISTRY: gcr.io - IMAGE_NAME: skylight-docker-images/gh-actions/${{ github.repository }}/${{ github.ref_name }} + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: build-and-push-image: runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: - name: Checkout repository uses: actions/checkout@v3 with: lfs: false - - name: Authenticate to Google Cloud - id: auth - uses: google-github-actions/auth@v1 + - name: Log in to the Container registry + uses: docker/login-action@v2 with: - credentials_json: "${{ secrets.ENCODED_GCR_KEY }}" - - - name: Configure Docker - run: gcloud auth configure-docker + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Extract metadata (tags, labels) for Docker id: meta @@ -33,11 +35,12 @@ jobs: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | type=sha,format=short - type=raw,value=latest + type=raw,value=latest,enable={{is_default_branch}} + - name: Build and push Docker image uses: docker/build-push-action@v3 with: - context: . + context: ais/ push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}