Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

ci(docker): fix short sha generation, seperate jobs for parallel execution

Amruth Pillai28ba2b1b8fc4
diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml
index 2bafce1fa..2409ccbf9 100644
--- a/.github/workflows/docker-build-push.yml
+++ b/.github/workflows/docker-build-push.yml
@@ -1,4 +1,4 @@
-name: Build and Push to Docker Hub
+name: Build and Push Docker Image
on:
push:
@@ -6,30 +6,53 @@ on:
- 'v3'
jobs:
- docker:
+ docker_client:
+ name: Docker (Client)
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/[email protected]
- - name: Get Short Commit SHA
+ - id: slug
+ name: Get Short Commit SHA
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- - name: Login to Docker Hub
+ - name: Login to Docker
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- - name: Login to GitHub Container Registry
+ - name: Build and Push Client Image
+ uses: docker/[email protected]
+ with:
+ context: .
+ push: true
+ file: client/Dockerfile
+ tags: |
+ amruthpillai/reactive-resume:client-latest
+ amruthpillai/reactive-resume:client-${{ steps.slug.outputs.sha8 }}
+
+ docker_server:
+ name: Docker (Server)
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout the repository
+ uses: actions/[email protected]
+
+ - id: slug
+ name: Get Short Commit SHA
+ run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
+
+ - name: Login to Docker
uses: docker/[email protected]
with:
- registry: ghcr.io
- username: $GITHUB_REPOSITORY_OWNER
- password: ${{ secrets.GH_TOKEN }}
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
- - name: Build and Push Server Docker Image
+ - name: Build and Push Server Image
uses: docker/[email protected]
with:
context: .
@@ -38,17 +61,61 @@ jobs:
tags: |
amruthpillai/reactive-resume:server-latest
amruthpillai/reactive-resume:server-${{ steps.slug.outputs.sha8 }}
- ghcr.io/amruthpillai/reactive-resume:server-latest
- ghcr.io/amruthpillai/reactive-resume:server-${{ steps.slug.outputs.sha8 }}
- - name: Build and Push Client Docker Image
+ github_client:
+ name: GitHub (Client)
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout the repository
+ uses: actions/[email protected]
+
+ - id: slug
+ name: Get Short Commit SHA
+ run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
+
+ - name: Login to GitHub Container Registry
+ uses: docker/[email protected]
+ with:
+ registry: ghcr.io
+ username: $GITHUB_REPOSITORY_OWNER
+ password: ${{ secrets.GH_TOKEN }}
+
+ - name: Build and Push Client Image
uses: docker/[email protected]
with:
context: .
push: true
file: client/Dockerfile
tags: |
- amruthpillai/reactive-resume:client-latest
- amruthpillai/reactive-resume:client-${{ steps.slug.outputs.sha8 }}
ghcr.io/amruthpillai/reactive-resume:client-latest
ghcr.io/amruthpillai/reactive-resume:client-${{ steps.slug.outputs.sha8 }}
+
+ github_server:
+ name: GitHub (Server)
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout the repository
+ uses: actions/[email protected]
+
+ - id: slug
+ name: Get Short Commit SHA
+ run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
+
+ - name: Login to GitHub Container Registry
+ uses: docker/[email protected]
+ with:
+ registry: ghcr.io
+ username: $GITHUB_REPOSITORY_OWNER
+ password: ${{ secrets.GH_TOKEN }}
+
+ - name: Build and Push Server Image
+ uses: docker/[email protected]
+ with:
+ context: .
+ push: true
+ file: server/Dockerfile
+ tags: |
+ ghcr.io/amruthpillai/reactive-resume:server-latest
+ ghcr.io/amruthpillai/reactive-resume:server-${{ steps.slug.outputs.sha8 }}