Skip to content

v20240104-nightly

v20240104-nightly #35

name: Build, push, test and deploy Docker image
on:
push:
branches: [master, develop]
release:
types: [created]
pull_request:
types: [labeled, synchronize, opened, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-play:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# docker
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to OCIR
uses: docker/login-action@v2
with:
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ secrets.OCI_USERNAME }}
password: ${{ secrets.OCI_TOKEN }}
- uses: rlespinasse/[email protected]
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-play
- name: Build and push
uses: docker/build-push-action@v3
if: ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'deploy') || contains(github.event.pull_request.labels.*.name, 'build')) }}
with:
context: .
file: play/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-play:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
cache-from: |
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-play:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-play:develop
cache-to: type=inline
labels: ${{ steps.meta.outputs.labels }}
build-chat:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# docker
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to OCIR
uses: docker/login-action@v2
with:
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ secrets.OCI_USERNAME }}
password: ${{ secrets.OCI_TOKEN }}
- uses: rlespinasse/[email protected]
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-chat
- name: Build and push
uses: docker/build-push-action@v3
if: ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'deploy') || contains(github.event.pull_request.labels.*.name, 'build')) }}
with:
context: .
file: chat/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-chat:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
cache-from: |
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-chat:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-chat:develop
cache-to: type=inline
labels: ${{ steps.meta.outputs.labels }}
build-back:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# docker
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to OCIR
uses: docker/login-action@v2
with:
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ secrets.OCI_USERNAME }}
password: ${{ secrets.OCI_TOKEN }}
- uses: rlespinasse/[email protected]
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-back
- name: Replace version string
run: |
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
sed -i "s/dev/${GITHUB_REF_NAME}/" back/src/Services/version.ts
fi
- name: Build and push
uses: docker/build-push-action@v3
if: ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'deploy') || contains(github.event.pull_request.labels.*.name, 'build')) }}
with:
context: .
file: back/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-back:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
cache-from: |
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-back:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-back:develop
cache-to: type=inline
labels: ${{ steps.meta.outputs.labels }}
build-uploader:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to OCIR
uses: docker/login-action@v2
with:
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ secrets.OCI_USERNAME }}
password: ${{ secrets.OCI_TOKEN }}
- uses: rlespinasse/[email protected]
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-uploader
- name: Build and push
uses: docker/build-push-action@v3
if: ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'deploy') || contains(github.event.pull_request.labels.*.name, 'build')) }}
with:
file: uploader/Dockerfile
push: true
tags: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-uploader:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
cache-from: |
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-uploader:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-uploader:develop
cache-to: type=inline
labels: ${{ steps.meta.outputs.labels }}
build-maps:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to OCIR
uses: docker/login-action@v2
with:
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ secrets.OCI_USERNAME }}
password: ${{ secrets.OCI_TOKEN }}
- uses: rlespinasse/[email protected]
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-maps
- name: Build and push
uses: docker/build-push-action@v3
if: ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'deploy') || contains(github.event.pull_request.labels.*.name, 'build')) }}
with:
context: maps/
file: maps/Dockerfile
push: true
tags: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-maps:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
cache-from: |
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-maps:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-maps:develop
cache-to: type=inline
labels: ${{ steps.meta.outputs.labels }}
build-map-storage:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# docker
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to OCIR
uses: docker/login-action@v2
with:
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ secrets.OCI_USERNAME }}
password: ${{ secrets.OCI_TOKEN }}
- uses: rlespinasse/[email protected]
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-map-storage
- name: Build and push
uses: docker/build-push-action@v3
if: ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'deploy') || contains(github.event.pull_request.labels.*.name, 'build')) }}
with:
context: .
file: map-storage/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-map-storage:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
cache-from: |
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-map-storage:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-map-storage:develop
cache-to: type=inline
labels: ${{ steps.meta.outputs.labels }}
build-ejabberd:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# docker
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to OCIR
uses: docker/login-action@v2
with:
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ secrets.OCI_USERNAME }}
password: ${{ secrets.OCI_TOKEN }}
- uses: rlespinasse/[email protected]
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-ejabberd
- name: Build and push
uses: docker/build-push-action@v3
if: ${{ github.event_name == 'push' || github.event_name == 'release' || github.event_name == 'pull_request' && (contains(github.event.pull_request.labels.*.name, 'deploy') || contains(github.event.pull_request.labels.*.name, 'build')) }}
with:
context: xmpp/
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-ejabberd:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
cache-from: |
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-ejabberd:${{ github.event_name == 'pull_request' && env.GITHUB_HEAD_REF_SLUG || env.GITHUB_REF_SLUG }}
type=registry,ref=${{ vars.CONTAINER_REGISTRY_ACCOUNT }}/workadventure-ejabberd:develop
cache-to: type=inline
labels: ${{ steps.meta.outputs.labels }}