Skip to content

Update docker.yml

Update docker.yml #96

Workflow file for this run

name: Build and Publish the Docker Image
on:
push:
branches:
- master
env:
GITHUB_SHA: ${{ github.sha }}
IMAGE: ssr
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
with:
node-version: '14'
- name: Install Dependencies
run: yarn install --production=false
- name: Build API
run: yarn build
- name: Prune Dev Dependencies
run: npm prune --production
- name: Build Docker Image
run: |
docker build \
-t "$REGISTRY_HOSTNAME"/cytoid/"$IMAGE" \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" .
- name: Publish Docker Image
run: |
docker push "$REGISTRY_HOSTNAME"/cytoid/"$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