AFFiNE/.github/workflows/affine.yml

86 lines
2.8 KiB
YAML
Raw Normal View History

2022-08-04 11:17:46 +03:00
name: Build AFFiNE-Local
on:
push:
branches: [master]
2022-08-07 14:06:14 +03:00
# pull_request:
# branches: [master]
2022-08-04 11:17:46 +03:00
# Cancels all previous workflow runs for pull requests that have not completed.
# See https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# The concurrency group contains the workflow name and the branch name for
# pull requests or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
NAMESPACE: toeverything
AFFINE_IMAGE_NAME: AFFiNE
IMAGE_TAG_LATEST: nightly-latest
2022-08-12 15:01:51 +03:00
LOCAL_CACHE: localhost:5000/toeverything/relocate:latest
2022-08-04 11:17:46 +03:00
jobs:
ligo-virgo:
runs-on: self-hosted
environment: development
permissions:
contents: read
packages: write
2022-08-12 15:01:51 +03:00
services:
registry:
image: registry:2
ports:
- 5000:5000
2022-08-04 11:17:46 +03:00
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Log in to the Container registry
2022-08-12 15:01:51 +03:00
uses: docker/login-action@v2
2022-08-04 11:17:46 +03:00
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
2022-08-12 15:01:51 +03:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
driver-opts: network=host
2022-08-04 11:17:46 +03:00
- name: Extract metadata (tags, labels) for Docker (AFFiNE-Local)
id: meta_affine
2022-08-12 15:01:51 +03:00
uses: docker/metadata-action@v4
2022-08-04 11:17:46 +03:00
with:
images: ${{ env.REGISTRY }}/${{ env.NAMESPACE }}/${{ env.AFFINE_IMAGE_NAME }}
tags: ${{ env.IMAGE_TAG_LATEST }}
- name: Build and push Docker image (AFFINE-Local)
2022-08-12 15:01:51 +03:00
uses: docker/build-push-action@v3
2022-08-04 11:17:46 +03:00
with:
context: .
2022-08-12 15:01:51 +03:00
push: true
2022-08-04 11:17:46 +03:00
file: ./.github/deployment/Dockerfile-affine
2022-08-12 15:01:51 +03:00
tags: ${{ env.LOCAL_CACHE }}
target: AFFiNE
- name: Build and push Docker image (AFFINE-Local)
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64/v8
file: ./.github/deployment/Dockerfile-affine-multiplatform
2022-08-04 11:17:46 +03:00
push: ${{ github.ref == 'refs/heads/master' && true || false }}
tags: ${{ steps.meta_affine.outputs.tags }}
labels: ${{ steps.meta_affine.outputs.labels }}
target: AFFiNE
2022-08-12 15:01:51 +03:00
build-args: |
BASE_IMAGE=${{ env.LOCAL_CACHE }}