mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-12 07:43:10 +10:00
59 lines
1.6 KiB
YAML
59 lines
1.6 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
|
|
|
|
strategy:
|
|
matrix:
|
|
image: [client, server]
|
|
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v3.5.2
|
|
|
|
- id: version
|
|
name: App Version
|
|
uses: martinbeentjes/npm-get-version-action@v1.3.1
|
|
|
|
- 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.5.0
|
|
|
|
- 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@v4.0.0
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/amd64
|
|
file: ${{ matrix.image }}/Dockerfile
|
|
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 }}
|