Skip to content

Commit

Permalink
build: Release (#2602)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrezza authored Oct 7, 2024
2 parents 9c6d024 + cd44ff3 commit 374b1a9
Show file tree
Hide file tree
Showing 39 changed files with 3,105 additions and 2,730 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,27 +76,34 @@ jobs:
include:
- name: Docker linux/amd64
DOCKER_PLATFORM: linux/amd64
# Building currently fails for the platforms below
# - name: Docker linux/arm/v6
# DOCKER_PLATFORM: linux/arm/v6
# - name: Docker linux/arm/v7
# DOCKER_PLATFORM: linux/arm/v7
RUNNER_TYPE: ubuntu-latest
# - name: Docker linux/arm64/v8
# DOCKER_PLATFORM: linux/arm64/v8
# # Replace this with a native arm linux runner when available, presumably by EOY 2024, see:
# # https://github.com/orgs/community/discussions/19197#discussioncomment-10550689
# # The conditional setup of QEMU may need to be adapted to not run on native arm,
# # which will speed up the build process for arm64/v8 since no emulation will be needed.
# RUNNER_TYPE: ubuntu-latest
fail-fast: false
name: ${{ matrix.name }}
timeout-minutes: 15
runs-on: ubuntu-latest
timeout-minutes: 45
runs-on: ${{ matrix.RUNNER_TYPE }}
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
# Only set up QEMU if not running on native arm
if: ${{ matrix.DOCKER_PLATFORM != 'linux/amd64' && matrix.RUNNER_TYPE == 'ubuntu-latest' }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Build docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
platforms: ${{ matrix.DOCKER_PLATFORM }}
cache-from: type=gha
cache-to: type=gha,mode=max
check-lock-file-version:
name: NPM Lock File Version
timeout-minutes: 5
Expand All @@ -112,9 +119,11 @@ jobs:
matrix:
include:
- name: Node 18
NODE_VERSION: 18.19.1
NODE_VERSION: 18.20.4
- name: Node 20
NODE_VERSION: 20.11.1
NODE_VERSION: 20.18.0
- name: Node 22
NODE_VERSION: 22.9.0
fail-fast: false
name: ${{ matrix.name }}
timeout-minutes: 15
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/release-automated.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
REGISTRY: docker.io
IMAGE_NAME: parseplatform/parse-dashboard
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
packages: write
Expand All @@ -52,29 +53,33 @@ jobs:
ref: ${{ needs.release.outputs.current_tag }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Log into Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=${{ steps.branch.outputs.branch_name == 'release' }}
tags: |
type=semver,pattern={{version}},value=${{ needs.release.outputs.current_tag }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
platforms: linux/amd64, linux/arm64/v8
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
17 changes: 11 additions & 6 deletions .github/workflows/release-manual-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ env:
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
permissions:
contents: read
packages: write
Expand All @@ -28,18 +29,20 @@ jobs:
ref: ${{ github.event.inputs.ref }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Log into Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
Expand All @@ -48,10 +51,12 @@ jobs:
type=semver,enable=true,pattern={{version}},value=${{ github.event.inputs.ref }}
type=raw,enable=${{ github.event.inputs.ref == '' }},value=latest
- name: Build and push Docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
platforms: linux/amd64, linux/arm64/v8
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
############################################################
# Build stage
############################################################
FROM node:lts-alpine AS build
FROM node:20.17.0-alpine3.20 AS build

RUN apk --no-cache add git
WORKDIR /src
Expand All @@ -27,7 +27,7 @@ RUN npm run prepare && npm run build
############################################################
# Release stage
############################################################
FROM node:lts-alpine AS release
FROM node:20.17.0-alpine3.20 AS release
WORKDIR /src

# Copy production node_modules
Expand Down
Loading

0 comments on commit 374b1a9

Please sign in to comment.