refact!: dockerization + federation/multi-node portal #61
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
release: | |
types: [ published ] | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
build-server: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log into the container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up edge/PR server image metadata | |
id: meta-edge | |
uses: docker/metadata-action@v5 | |
if: ${{ github.event_name != 'release' }} | |
with: | |
images: | | |
ghcr.io/c3g/epivar-server | |
flavor: | | |
latest=false | |
tags: | | |
type=raw,value=edge,enable={{is_default_branch}} | |
type=ref,event=pr | |
type=sha,prefix=sha- | |
- name: Build and push edge/PR server image | |
uses: docker/build-push-action@v5 | |
if: ${{ github.event_name != 'release' }} | |
with: | |
context: . | |
file: spec/server.Dockerfile | |
push: true | |
tags: ${{ steps.meta-edge.outputs.tags }} | |
labels: ${{ steps.meta-edge.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Set up server release image metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
images: | | |
ghcr.io/c3g/epivar-server | |
flavor: | | |
latest=true | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build and push server release image | |
uses: docker/build-push-action@v5 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
context: . | |
file: spec/server.Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-portal: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log into the container registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up edge/PR portal image metadata | |
id: meta-edge | |
uses: docker/metadata-action@v5 | |
if: ${{ github.event_name != 'release' }} | |
with: | |
images: | | |
ghcr.io/c3g/epivar-portal | |
flavor: | | |
latest=false | |
tags: | | |
type=raw,value=edge,enable={{is_default_branch}} | |
type=ref,event=pr | |
type=sha,prefix=sha- | |
- name: Build and push edge/PR portal image | |
uses: docker/build-push-action@v5 | |
if: ${{ github.event_name != 'release' }} | |
with: | |
context: . | |
file: spec/portal.Dockerfile | |
push: true | |
tags: ${{ steps.meta-edge.outputs.tags }} | |
labels: ${{ steps.meta-edge.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
- name: Set up portal release image metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
images: | | |
ghcr.io/c3g/epivar-portal | |
flavor: | | |
latest=true | |
tags: | | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Build and push portal release image | |
uses: docker/build-push-action@v5 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
context: . | |
file: spec/portal.Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64,linux/arm64 | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |