Skip to content

Update plugin bundle #100

Update plugin bundle

Update plugin bundle #100

name: Build Docker Image
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- 'main'
pull_request:
branches:
- '**'
jobs:
build-and-push:
if: github.event.pull_request.head.repo.fork != true
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
nocobase/website
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to Aliyun Container Registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.WEBSITE_DOCKER_REGISTRY }}
username: ${{ secrets.WEBSITE_DOCKER_USERNAME }}
password: ${{ secrets.WEBSITE_DOCKER_PASSWORD }}
- name: Set tags
id: set-tags
run: |
echo "::set-output name=tags::${{ secrets.WEBSITE_DOCKER_REGISTRY }}/${{ steps.meta.outputs.tags }}"
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
push: true
tags: ${{ steps.set-tags.outputs.tags }}
- name: Setup SSH
uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Execute remote command
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.WEBSITE_HOST }} 'cd ${{ secrets.WEBSITE_DIR }} && docker compose pull && docker compose up -d'