121 lines
3.3 KiB
YAML
121 lines
3.3 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
docker_client:
|
|
name: Docker (Client)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v3.0.0
|
|
|
|
- id: version
|
|
name: Get Version
|
|
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
|
|
|
|
- name: Login to Docker
|
|
uses: docker/login-action@v1.14.1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and Push Client Image
|
|
uses: docker/build-push-action@v2.9.0
|
|
with:
|
|
context: .
|
|
push: true
|
|
file: client/Dockerfile
|
|
tags: |
|
|
amruthpillai/reactive-resume:client-latest
|
|
amruthpillai/reactive-resume:client-${{ steps.version.outputs.tag }}
|
|
|
|
docker_server:
|
|
name: Docker (Server)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v3.0.0
|
|
|
|
- id: version
|
|
name: Get Version
|
|
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
|
|
|
|
- name: Login to Docker
|
|
uses: docker/login-action@v1.14.1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Build and Push Server Image
|
|
uses: docker/build-push-action@v2.9.0
|
|
with:
|
|
context: .
|
|
push: true
|
|
file: server/Dockerfile
|
|
tags: |
|
|
amruthpillai/reactive-resume:server-latest
|
|
amruthpillai/reactive-resume:server-${{ steps.version.outputs.tag }}
|
|
|
|
github_client:
|
|
name: GitHub (Client)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v3.0.0
|
|
|
|
- id: version
|
|
name: Get Version
|
|
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v1.14.1
|
|
with:
|
|
registry: ghcr.io
|
|
username: $GITHUB_REPOSITORY_OWNER
|
|
password: ${{ secrets.GH_TOKEN }}
|
|
|
|
- name: Build and Push Client Image
|
|
uses: docker/build-push-action@v2.9.0
|
|
with:
|
|
context: .
|
|
push: true
|
|
file: client/Dockerfile
|
|
tags: |
|
|
ghcr.io/amruthpillai/reactive-resume:client-latest
|
|
ghcr.io/amruthpillai/reactive-resume:client-${{ steps.version.outputs.tag }}
|
|
|
|
github_server:
|
|
name: GitHub (Server)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v3.0.0
|
|
|
|
- id: version
|
|
name: Get Version
|
|
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v1.14.1
|
|
with:
|
|
registry: ghcr.io
|
|
username: $GITHUB_REPOSITORY_OWNER
|
|
password: ${{ secrets.GH_TOKEN }}
|
|
|
|
- name: Build and Push Server Image
|
|
uses: docker/build-push-action@v2.9.0
|
|
with:
|
|
context: .
|
|
push: true
|
|
file: server/Dockerfile
|
|
tags: |
|
|
ghcr.io/amruthpillai/reactive-resume:server-latest
|
|
ghcr.io/amruthpillai/reactive-resume:server-${{ steps.version.outputs.tag }}
|