mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-12 15:52:56 +10:00
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2.9.0 to 2.9.1. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v2.9.0...v2.9.1) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
143 lines
3.8 KiB
YAML
143 lines
3.8 KiB
YAML
name: Build and Deploy
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
release:
|
|
types: [published]
|
|
|
|
jobs:
|
|
build-amd64:
|
|
name: Build (amd64)
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
image:
|
|
- client
|
|
- server
|
|
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v3.5.3
|
|
|
|
- name: Retrieve version from package.json
|
|
id: version
|
|
uses: martinbeentjes/npm-get-version-action@v1.3.1
|
|
|
|
- name: Docker Metadaata
|
|
id: meta
|
|
uses: docker/metadata-action@v4.6.0
|
|
with:
|
|
images: amruthpillai/reactive-resume
|
|
tags: |
|
|
type=raw,value=${{ matrix.image }}-latest
|
|
type=raw,value=${{ matrix.image }}-${{ steps.version.outputs.current-version }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2.2.0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2.9.1
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v2.2.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v2.2.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: $GITHUB_REPOSITORY_OWNER
|
|
password: ${{ secrets.GH_TOKEN }}
|
|
|
|
- name: Build and Push
|
|
id: build
|
|
uses: docker/build-push-action@v4.1.1
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/amd64
|
|
file: ${{ matrix.image }}/Dockerfile
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
build-args: |
|
|
TURBO_TOKEN=${{ secrets.TURBO_TOKEN }}
|
|
|
|
build-arm64:
|
|
name: Build (arm64)
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
image:
|
|
- client
|
|
- server
|
|
|
|
steps:
|
|
- name: Checkout the repository
|
|
uses: actions/checkout@v3.5.3
|
|
|
|
- name: Retrieve version from package.json
|
|
id: version
|
|
uses: martinbeentjes/npm-get-version-action@v1.3.1
|
|
|
|
- name: Docker Metadaata
|
|
id: meta
|
|
uses: docker/metadata-action@v4.6.0
|
|
with:
|
|
images: amruthpillai/reactive-resume
|
|
tags: |
|
|
type=raw,value=${{ matrix.image }}-latest
|
|
type=raw,value=${{ matrix.image }}-${{ steps.version.outputs.current-version }}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v2.2.0
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2.9.1
|
|
|
|
- name: Login to Docker Hub
|
|
uses: docker/login-action@v2.2.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v2.2.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: $GITHUB_REPOSITORY_OWNER
|
|
password: ${{ secrets.GH_TOKEN }}
|
|
|
|
- name: Build and Push
|
|
id: build
|
|
uses: docker/build-push-action@v4.1.1
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/arm64
|
|
file: ${{ matrix.image }}/Dockerfile
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
build-args: |
|
|
TURBO_TOKEN=${{ secrets.TURBO_TOKEN }}
|
|
|
|
deploy:
|
|
name: Deploy
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: build-amd64
|
|
|
|
steps:
|
|
- name: Install DigitalOcean CLI
|
|
uses: digitalocean/action-doctl@v2.3.0
|
|
with:
|
|
token: ${{ secrets.DIGITALOCEAN_TOKEN }}
|
|
|
|
- name: Create Deployment with Latest Version
|
|
run: doctl apps create-deployment ${{ secrets.DIGITALOCEAN_APP_ID }} --wait --force-rebuild
|