Skip to content

Commit

Permalink
Update docker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Neo-Zhixing committed Aug 15, 2023
1 parent 236b862 commit ffb019f
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ on:
env:
GITHUB_SHA: ${{ github.sha }}
IMAGE: ssr
REGISTRY_HOSTNAME: gcr.io
GCP_PROJECT: ${{ secrets.GCP_PROJECT }}
REGISTRY_HOSTNAME: ghcr.io
NODE_ENV: production
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
Expand All @@ -25,23 +26,14 @@ jobs:
run: yarn build
- name: Prune Dev Dependencies
run: npm prune --production
- uses: 'google-github-actions/auth@v1'
with:
credentials_json: ${{ secrets.GCP_KEY }}
service_account: ${{ secrets.GCP_EMAIL }}
- uses: google-github-actions/setup-gcloud@v1
- 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
- name: 'gcr.io/cloud-builders/gsutil'
run: gsutil -m -h "Cache-Control:public, max-age=604800" rsync -r -c -d ./.nuxt/dist/client gs://static.cytoid.io
docker push "$REGISTRY_HOSTNAME"/${{ github.repository_owner }}/"$IMAGE"
#- name: 'gcr.io/cloud-builders/gsutil'
# run: gsutil -m -h "Cache-Control:public, max-age=604800" rsync -r -c -d ./.nuxt/dist/client gs://static.cytoid.io

0 comments on commit ffb019f

Please sign in to comment.