Skip to content

Commit

Permalink
build docker for dev site on merge to main
Browse files Browse the repository at this point in the history
  • Loading branch information
glimberg committed Aug 15, 2024
1 parent 0c2b2b1 commit 0b77da4
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 15 deletions.
16 changes: 1 addition & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,4 @@ jobs:
with:
cmd: lint
env:
NODE_OPTIONS: --openssl-legacy-provider

- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.DOCKER_REGISTRY_WRITER }}'

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'

- name: Docker Build
run: |
gcloud info
gcloud auth configure-docker ${{ secrets.GCLOUD_DOCKER_HOST }}
docker build -t ${{ secrets.GCLOUD_DOCKER_HOST }}/${{ secrets.GCLOUD_PROJECT_ID }}/zt-docker/docs-zerotier-com:${{ github.sha }} . --push
NODE_OPTIONS: --openssl-legacy-provider
61 changes: 61 additions & 0 deletions .github/workflows/deploy_dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Deploy to Dev
on:
push:
branches:
- main

jobs:
build:
name: Build
runs-on: gha-runner-x64

steps:
- uses: actions/checkout@v4

- name: Set Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x

- name: yarn@4.1.1
run: |
corepack enable && corepack prepare yarn@4.1.1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Get yarn cache
uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-${{ runner.arch }}-yarn-docs-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-yarn-docs-
- name: Install dependencies
uses: borales/actions-yarn@v5
with:
cmd: install --immutable

- name: Build
uses: borales/actions-yarn@v5
with:
cmd: build
env:
NODE_OPTIONS: --openssl-legacy-provider

- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
credentials_json: '${{ secrets.DOCKER_REGISTRY_WRITER }}'

- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'

- name: Docker Build
run: |
gcloud auth configure-docker ${{ secrets.GCLOUD_DOCKER_HOST }}
docker build -t ${{ secrets.GCLOUD_DOCKER_HOST }}/${{ secrets.GCLOUD_PROJECT_ID }}/zt-docker/docs-zerotier-com:${{ github.sha }} . --push

0 comments on commit 0b77da4

Please sign in to comment.