build: docker images (#2860)

This commit is contained in:
LongYinan
2023-06-27 17:23:19 +08:00
committed by GitHub
parent 05452bb297
commit dd58b1bbf6
13 changed files with 155 additions and 288 deletions

View File

@@ -400,3 +400,60 @@ jobs:
flags: unittest
name: affine
fail_ci_if_error: true
build-docker:
if: github.ref == 'refs/heads/master'
name: Build Docker
needs:
- build-web-desktop
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download next static
uses: actions/download-artifact@v3
with:
name: next-js-static
path: ./apps/web/out
- name: Setup Git short hash
run: |
echo "GIT_SHORT_HASH=$(git rev-parse --short HEAD)" >> "$GITHUB_ENV"
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
logout: false
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build front Dockerfile
uses: docker/build-push-action@v4
with:
context: .
push: true
pull: true
platforms: linux/amd64,linux/arm64
provenance: true
file: .github/deployment/front/Dockerfile
tags: ghcr.io/toeverything/affine-front:${{ env.GIT_SHORT_HASH }},ghcr.io/toeverything/affine-front:latest
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
package-install: false
- name: Install Node.js dependencies
run: yarn workspaces focus @affine/server --production
- name: Build graphql Dockerfile
uses: docker/build-push-action@v4
with:
context: .
push: true
pull: true
platforms: linux/amd64,linux/arm64
provenance: true
file: .github/deployment/node/Dockerfile
tags: ghcr.io/toeverything/affine-graphql:${{ env.GIT_SHORT_HASH }},ghcr.io/toeverything/affine-graphql:latest