Skip to content

Commit

Permalink
Update docker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo-Zhixing authored Aug 15, 2023
1 parent 76e3e98 commit 656f81c
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,20 @@ on:
env:
GITHUB_SHA: ${{ github.sha }}
IMAGE: images
REGISTRY_HOSTNAME: gcr.io
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
REGISTRY_HOSTNAME: ghcr.io
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
version: '270.0.0'
service_account_email: ${{ secrets.GCP_EMAIL }}
service_account_key: ${{ secrets.GCP_KEY }}
- run: |
# Set up docker to authenticate
# via gcloud command-line tool.
gcloud auth configure-docker
- name: Build Docker Image
run: |
docker build \
-t "$REGISTRY_HOSTNAME"/"$GCP_PROJECT"/"$IMAGE" \
-t "$REGISTRY_HOSTNAME"/${{ github.repository_owner }}/"$IMAGE" \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" .
- name: Publish Docker Image
run: |
docker push $REGISTRY_HOSTNAME/$GCP_PROJECT/$IMAGE
docker push "$REGISTRY_HOSTNAME"/${{ github.repository_owner }}/"$IMAGE"

0 comments on commit 656f81c

Please sign in to comment.