mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-10 04:22:27 +10:00
75 lines
2.2 KiB
YAML
75 lines
2.2 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build_matrix:
|
|
name: Build and Push Docker Image
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
|
|
strategy:
|
|
matrix:
|
|
image: [client, server]
|
|
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v3.1.0
|
|
|
|
- id: version
|
|
name: App Version
|
|
uses: martinbeentjes/npm-get-version-action@v1.2.3
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2.1.0
|
|
with:
|
|
platforms: amd64
|
|
|
|
- id: buildx
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2.2.1
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v2.1.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v2.1.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: $GITHUB_REPOSITORY_OWNER
|
|
password: ${{ secrets.GH_TOKEN }}
|
|
|
|
- name: Build and Push Docker Image
|
|
uses: docker/build-push-action@v3.2.0
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/amd64
|
|
file: ${{ matrix.image }}/Dockerfile
|
|
secrets: |
|
|
"SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}"
|
|
tags: |
|
|
amruthpillai/reactive-resume:${{ matrix.image }}-latest
|
|
amruthpillai/reactive-resume:${{ matrix.image }}-${{ steps.version.outputs.current-version }}
|
|
ghcr.io/amruthpillai/reactive-resume:${{ matrix.image }}-latest
|
|
ghcr.io/amruthpillai/reactive-resume:${{ matrix.image }}-${{ steps.version.outputs.current-version }}
|
|
|
|
- name: Create Sentry Release
|
|
uses: getsentry/action-release@v1.2.1
|
|
env:
|
|
SENTRY_ORG: reactive-resume
|
|
SENTRY_PROJECT: ${{ matrix.image }}
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
with:
|
|
environment: production
|
|
version: ${{ steps.version.outputs.current-version }}
|