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!

update github actions to a more streamlined workflow using gh matrix

Amruth Pillaiab6ad654453e
diff --git a/.github/workflows/digitalocean-deploy.yml b/.github/workflows/digitalocean-deploy.yml
index ad056d814..e07b82488 100644
--- a/.github/workflows/digitalocean-deploy.yml
+++ b/.github/workflows/digitalocean-deploy.yml
@@ -8,9 +8,8 @@ on:
- completed
jobs:
- deploy:
+ on-success:
runs-on: ubuntu-latest
-
steps:
- name: Install DigitalOcean CLI
uses: digitalocean/[email protected]
@@ -19,3 +18,9 @@ jobs:
- name: Create Deployment with Latest Version
run: doctl apps create-deployment ${{ secrets.DIGITALOCEAN_APP_ID }} --wait --force-rebuild
+
+ on-failure:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Abruptly end the worklfow
+ run: exit 1
diff --git a/.github/workflows/docker-build-push-v2.yml b/.github/workflows/docker-build-push-v2.yml
deleted file mode 100644
index ccdc02cba..000000000
--- a/.github/workflows/docker-build-push-v2.yml
+++ /dev/null
@@ -1,59 +0,0 @@
-name: Build and Push Docker Image (v2)
-
-on: [workflow_dispatch]
-
-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:
- arch: [amd64, arm64]
- image: [client, server]
-
- steps:
- - name: Checkout the repository
- uses: actions/[email protected]
-
- - id: version
- name: App Version
- uses: martinbeentjes/[email protected]
-
- - name: Set up QEMU
- uses: docker/[email protected]
- with:
- platforms: ${{ matrix.arch }}
-
- - id: buildx
- name: Set up Docker Buildx
- uses: docker/[email protected]
-
- - name: Login to Docker Hub
- uses: docker/[email protected]
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
-
- - 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 Docker Image
- uses: docker/[email protected]
- with:
- context: .
- push: true
- 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 }}
diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml
index 6fae56980..bcf969de7 100644
--- a/.github/workflows/docker-build-push.yml
+++ b/.github/workflows/docker-build-push.yml
@@ -5,85 +5,35 @@ on:
types: [published]
jobs:
- client:
- name: Client
+ build_matrix:
+ name: Build and Push Docker Image
runs-on: ubuntu-latest
env:
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
- steps:
- - name: Checkout the repository
- uses: actions/[email protected]
- with:
- fetch-depth: 2
-
- - id: version
- name: Get Version
- run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
-
- - name: Set up QEMU
- uses: docker/[email protected]
-
- - id: buildx
- name: Set up Docker Buildx
- uses: docker/[email protected]
- with:
- install: true
-
- - name: Login to Docker Hub
- uses: docker/[email protected]
- with:
- username: ${{ secrets.DOCKER_USERNAME }}
- password: ${{ secrets.DOCKER_PASSWORD }}
-
- - 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
- platforms: linux/amd64,linux/arm64
- tags: |
- amruthpillai/reactive-resume:client-latest
- amruthpillai/reactive-resume:client-${{ env.version }}
- ghcr.io/amruthpillai/reactive-resume:client-latest
- ghcr.io/amruthpillai/reactive-resume:client-${{ env.version }}
-
- server:
- name: Server
- runs-on: ubuntu-latest
-
- env:
- TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
- TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ strategy:
+ matrix:
+ arch: [amd64, arm64]
+ image: [client, server]
steps:
- name: Checkout the repository
uses: actions/[email protected]
- with:
- fetch-depth: 2
- id: version
- name: Get Version
- run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
+ name: App Version
+ uses: martinbeentjes/[email protected]
- name: Set up QEMU
uses: docker/[email protected]
+ with:
+ platforms: ${{ matrix.arch }}
- id: buildx
name: Set up Docker Buildx
uses: docker/[email protected]
- with:
- install: true
- name: Login to Docker Hub
uses: docker/[email protected]
@@ -98,15 +48,14 @@ jobs:
username: $GITHUB_REPOSITORY_OWNER
password: ${{ secrets.GH_TOKEN }}
- - name: Build and Push Server Image
+ - name: Build and Push Docker Image
uses: docker/[email protected]
with:
context: .
push: true
- file: server/Dockerfile
- platforms: linux/amd64,linux/arm64
+ file: ${{ matrix.image }}/Dockerfile
tags: |
- amruthpillai/reactive-resume:server-latest
- amruthpillai/reactive-resume:server-${{ env.version }}
- ghcr.io/amruthpillai/reactive-resume:server-latest
- ghcr.io/amruthpillai/reactive-resume:server-${{ env.version }}
+ 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 }}