mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-12 15:52:56 +10:00
update github actions to a more streamlined workflow using gh matrix
This commit is contained in:
9
.github/workflows/digitalocean-deploy.yml
vendored
9
.github/workflows/digitalocean-deploy.yml
vendored
@ -8,9 +8,8 @@ on:
|
|||||||
- completed
|
- completed
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
on-success:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Install DigitalOcean CLI
|
- name: Install DigitalOcean CLI
|
||||||
uses: digitalocean/action-doctl@v2.2.0
|
uses: digitalocean/action-doctl@v2.2.0
|
||||||
@ -19,3 +18,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Create Deployment with Latest Version
|
- name: Create Deployment with Latest Version
|
||||||
run: doctl apps create-deployment ${{ secrets.DIGITALOCEAN_APP_ID }} --wait --force-rebuild
|
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
|
||||||
|
|||||||
59
.github/workflows/docker-build-push-v2.yml
vendored
59
.github/workflows/docker-build-push-v2.yml
vendored
@ -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/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: ${{ matrix.arch }}
|
|
||||||
|
|
||||||
- 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
|
|
||||||
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 }}
|
|
||||||
85
.github/workflows/docker-build-push.yml
vendored
85
.github/workflows/docker-build-push.yml
vendored
@ -5,32 +5,35 @@ on:
|
|||||||
types: [published]
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
client:
|
build_matrix:
|
||||||
name: Client
|
name: Build and Push Docker Image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
env:
|
env:
|
||||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: [amd64, arm64]
|
||||||
|
image: [client, server]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v3.1.0
|
uses: actions/checkout@v3.1.0
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- id: version
|
- id: version
|
||||||
name: Get Version
|
name: App Version
|
||||||
run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
uses: martinbeentjes/npm-get-version-action@v1.2.3
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.1.0
|
||||||
|
with:
|
||||||
|
platforms: ${{ matrix.arch }}
|
||||||
|
|
||||||
- id: buildx
|
- id: buildx
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2.2.1
|
uses: docker/setup-buildx-action@v2.2.1
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.1.0
|
||||||
@ -45,68 +48,14 @@ jobs:
|
|||||||
username: $GITHUB_REPOSITORY_OWNER
|
username: $GITHUB_REPOSITORY_OWNER
|
||||||
password: ${{ secrets.GH_TOKEN }}
|
password: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
- name: Build and Push Client Image
|
- name: Build and Push Docker Image
|
||||||
uses: docker/build-push-action@v3.2.0
|
uses: docker/build-push-action@v3.2.0
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
file: client/Dockerfile
|
file: ${{ matrix.image }}/Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
tags: |
|
tags: |
|
||||||
amruthpillai/reactive-resume:client-latest
|
amruthpillai/reactive-resume:${{ matrix.image }}-latest
|
||||||
amruthpillai/reactive-resume:client-${{ env.version }}
|
amruthpillai/reactive-resume:${{ matrix.image }}-${{ steps.version.outputs.current-version }}
|
||||||
ghcr.io/amruthpillai/reactive-resume:client-latest
|
ghcr.io/amruthpillai/reactive-resume:${{ matrix.image }}-latest
|
||||||
ghcr.io/amruthpillai/reactive-resume:client-${{ env.version }}
|
ghcr.io/amruthpillai/reactive-resume:${{ matrix.image }}-${{ steps.version.outputs.current-version }}
|
||||||
|
|
||||||
server:
|
|
||||||
name: Server
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
env:
|
|
||||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout the repository
|
|
||||||
uses: actions/checkout@v3.1.0
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- id: version
|
|
||||||
name: Get Version
|
|
||||||
run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
|
||||||
|
|
||||||
- id: buildx
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2.2.1
|
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
|
|
||||||
- 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 Server Image
|
|
||||||
uses: docker/build-push-action@v3.2.0
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
file: server/Dockerfile
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
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 }}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user