plane/.github/workflows/push-image-frontend.yml

61 lines
1.9 KiB
YAML
Raw Normal View History

name: Build and Push Frontend Docker Image
2023-03-12 18:20:12 +00:00
on:
pull_request:
types: [closed]
branches: [develop]
release:
types: [released]
2023-03-12 18:20:12 +00:00
jobs:
build_push_frontend:
name: Build Frontend Docker Image
runs-on: ubuntu-20.04
steps:
- name: Check out the repo
uses: actions/checkout@v3.3.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.5.0
- name: Setup .npmrc for repository
run: |
echo -e "@tiptap-pro:registry=https://registry.tiptap.dev/\n//registry.tiptap.dev/:_authToken=${{ secrets.TIPTAP_TOKEN }}" > .npmrc
2023-03-12 18:20:12 +00:00
- name: Login to Docker Hub
uses: docker/login-action@v2.1.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Release
2023-03-12 18:20:12 +00:00
id: meta
if: ${{ github.event_name == 'release' }}
2023-03-12 18:20:12 +00:00
uses: docker/metadata-action@v4.3.0
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend
tags: |
type=ref,event=tag
2023-03-12 18:20:12 +00:00
- name: Extract metadata (tags, labels) for Docker (Docker Hub) from Github Pull Request
id: meta_pr
if: ${{ github.event_name == 'pull_request' }}
uses: docker/metadata-action@v4.3.0
with:
images: ${{ secrets.DOCKERHUB_USERNAME }}/plane-frontend
tags: type=raw,value=develop
- name: Build and Push to Docker Container Registry
2023-03-12 18:20:12 +00:00
uses: docker/build-push-action@v4.0.0
with:
context: .
file: ./apps/app/Dockerfile.web
platforms: linux/amd64
tags: ${{ github.event_name == 'release' && steps.meta.outputs.tags || steps.meta_pr.outputs.tags }}
2023-03-12 18:20:12 +00:00
push: true
env:
DOCKER_BUILDKIT: 1
DOCKER_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKET_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}