Skip to content

Commit

Permalink
change build push to github isntead of gcp
Browse files Browse the repository at this point in the history
  • Loading branch information
pbeukema committed Jul 13, 2023
1 parent 3303dde commit 8aa2ee9
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/push_image.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 }}

0 comments on commit 8aa2ee9

Please sign in to comment.