2023-05-03 08:06:55 +00:00
|
|
|
name: Build and Push Backend Docker Image
|
2023-03-12 18:20:12 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'develop'
|
2023-03-13 04:45:05 +00:00
|
|
|
- 'master'
|
2023-03-12 18:20:12 +00:00
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_push_backend:
|
2023-05-03 08:06:55 +00:00
|
|
|
name: Build and Push Api Server Docker Image
|
2023-03-12 18:20:12 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
|
|
|
uses: actions/checkout@v3.3.0
|
|
|
|
|
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v2.1.0
|
|
|
|
with:
|
|
|
|
platforms: linux/arm64,linux/amd64
|
|
|
|
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v2.5.0
|
|
|
|
|
2023-05-03 08:06:55 +00:00
|
|
|
- name: Login to GitHub Container Registry
|
2023-03-12 18:20:12 +00:00
|
|
|
uses: docker/login-action@v2.1.0
|
|
|
|
with:
|
|
|
|
registry: "ghcr.io"
|
|
|
|
username: ${{ github.actor }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-05-03 08:06:55 +00:00
|
|
|
- name: Login to Docker Hub
|
|
|
|
uses: docker/login-action@v2.1.0
|
|
|
|
with:
|
|
|
|
registry: "registry.hub.docker.com"
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
|
|
|
|
|
|
|
- name: Extract metadata (tags, labels) for Docker (Docker Hub)
|
|
|
|
id: ghmeta
|
|
|
|
uses: docker/metadata-action@v4.3.0
|
|
|
|
with:
|
|
|
|
images: makeplane/plane-backend
|
|
|
|
|
|
|
|
- name: Extract metadata (tags, labels) for Docker (Github)
|
|
|
|
id: dkrmeta
|
2023-03-12 18:20:12 +00:00
|
|
|
uses: docker/metadata-action@v4.3.0
|
|
|
|
with:
|
|
|
|
images: ghcr.io/${{ github.repository }}-backend
|
|
|
|
|
2023-05-03 08:06:55 +00:00
|
|
|
- name: Build and Push to GitHub Container Registry
|
|
|
|
uses: docker/build-push-action@v4.0.0
|
|
|
|
with:
|
|
|
|
context: ./apiserver
|
|
|
|
file: ./apiserver/Dockerfile.api
|
|
|
|
platforms: linux/arm64,linux/amd64
|
|
|
|
push: true
|
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha
|
|
|
|
tags: ${{ steps.ghmeta.outputs.tags }}
|
|
|
|
labels: ${{ steps.ghmeta.outputs.labels }}
|
|
|
|
|
|
|
|
- name: Build and Push to Docker Hub
|
2023-03-12 18:20:12 +00:00
|
|
|
uses: docker/build-push-action@v4.0.0
|
|
|
|
with:
|
|
|
|
context: ./apiserver
|
|
|
|
file: ./apiserver/Dockerfile.api
|
|
|
|
platforms: linux/arm64,linux/amd64
|
|
|
|
push: true
|
|
|
|
cache-from: type=gha
|
|
|
|
cache-to: type=gha
|
2023-05-03 08:06:55 +00:00
|
|
|
tags: ${{ steps.dkrmeta.outputs.tags }}
|
|
|
|
labels: ${{ steps.dkrmeta.outputs.labels }}
|
|
|
|
|