Skip to content

chore(release): 🔖 1.7.5 #70

chore(release): 🔖 1.7.5

chore(release): 🔖 1.7.5 #70

Workflow file for this run

name: "Build and Push for Production"
on:
push:
branches:
- master
# - dev
# - actions-docker # only for testing purpose
tags:
- "v*"
paths:
# - ".github/workflows/build-and-push.yaml"
- "src/**"
- "public/**"
- ".env.production"
jobs:
build-pages:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache .pnpm-store
uses: actions/cache@v1
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install pnpm
run: curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6
- name: Install packages
run: pnpm install
- name: Build pages
run: |
pnpm build
env:
NODE_OPTIONS: --max_old_space_size=4096
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: pages
path: |
build/
nginx/
Dockerfile.cloud
build-docker:
runs-on: ubuntu-latest
needs: build-pages
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: pages
- name: Rename Dockerfile
run: mv Dockerfile.cloud Dockerfile
- name: Setup buildx
uses: docker/setup-buildx-action@v1
- name: Dokcer meta
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ secrets.DOCKER_DOMAIN }}/sekai-viewer
tags: |
type=semver,pattern={{version}}
- name: Login to registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.DOCKER_DOMAIN }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}