@@ -0,0 +1,82 @@
|
||||
name: nightly-dockerbuild
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- nightly
|
||||
paths:
|
||||
- "**"
|
||||
- "!.github/**"
|
||||
- "!**.md"
|
||||
- "!docker-compose.yml"
|
||||
jobs:
|
||||
main:
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: ${{ matrix.experimental }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- app: frontend
|
||||
path: frontend
|
||||
version: nightly
|
||||
experimental: true
|
||||
- app: backend
|
||||
path: backend
|
||||
version: nightly
|
||||
experimental: true
|
||||
- app: orborus
|
||||
path: functions/onprem/orborus
|
||||
version: nightly
|
||||
experimental: true
|
||||
- app: worker
|
||||
path: functions/onprem/worker
|
||||
version: nightly
|
||||
experimental: true
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
with:
|
||||
platforms: "amd64,arm64,arm"
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Login to Ghcr
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Ghcr Build and push
|
||||
id: docker_build
|
||||
uses: docker/build-push-action@v4
|
||||
env:
|
||||
BUILDX_NO_DEFAULT_LOAD: true
|
||||
with:
|
||||
logout: false
|
||||
context: ${{ matrix.path }}/
|
||||
file: ${{ matrix.path }}/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
tags: |
|
||||
ghcr.io/shuffle/shuffle-${{ matrix.app }}:${{ matrix.version }}
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/shuffle-${{ matrix.app }}:${{ matrix.version }}
|
||||
frikky/shuffle-${{ matrix.app }}:${{ matrix.version }}
|
||||
frikky/shuffle:${{ matrix.app }}
|
||||
|
||||
- name: Image digest
|
||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||
@@ -33,16 +33,21 @@ jobs:
|
||||
sudo apt-get install helm -y --no-install-recommends
|
||||
|
||||
- name: Set versions
|
||||
id: set_versions
|
||||
run: |
|
||||
if [[ ${{ github.event_name }} == 'release' ]]; then
|
||||
CHART_VERSION="${{ github.event.release.tag_name }}"
|
||||
APP_VERSION="${{ github.event.release.tag_name }}"
|
||||
TAG_NAME="${{ github.event.release.tag_name }}"
|
||||
|
||||
# Remove the v prefix
|
||||
VERSION=${TAG_NAME#v}
|
||||
|
||||
APP_VERSION="${VERSION}"
|
||||
CHART_VERSION="${VERSION}"
|
||||
else
|
||||
CHART_VERSION="0.0.0-nightly-untagged-latest"
|
||||
APP_VERSION="nightly"
|
||||
CHART_VERSION="0.0.0-nightly-untagged-latest"
|
||||
fi
|
||||
|
||||
echo "APP_VERSION set to ${APP_VERSION}"
|
||||
echo "CHART_VERSION set to ${CHART_VERSION}. Validating..."
|
||||
|
||||
# https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
|
||||
@@ -55,8 +60,8 @@ jobs:
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
echo "CHART_VERSION=${CHART_VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "CHART_VERSION=${CHART_VERSION}" >> "$GITHUB_ENV"
|
||||
echo "APP_VERSION=${APP_VERSION}" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Update helm dependencies
|
||||
run: helm dependency update ./functions/kubernetes/charts/shuffle
|
||||
@@ -68,4 +73,4 @@ jobs:
|
||||
run: helm registry login ghcr.io --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Push helm chart
|
||||
run: helm push ./functions/kubernetes/charts/shuffle-*.tgz oci://ghcr.io/shuffle/shuffle/charts
|
||||
run: helm push ./functions/kubernetes/charts/shuffle-*.tgz oci://ghcr.io/shuffle/charts
|
||||
|
||||
Reference in New Issue
Block a user