Files
azerothcore-wotlk/.github/workflows/docker_build.yml
Kitzunu 5fafa92594 fix(CI/Docker): Run build on label (#8487)
* fix(Core/Player): Prevent exploit to loot items that are already looted

* 586c00fe2e

Co-Authored-By: Gildor <521036+Jildor@users.noreply.github.com>

* Revert "fix(Core/Player): Prevent exploit to loot items that are already looted"

This reverts commit 8376bba57925eda08e72d72e04fe6ce39fa354e2.

* refactor(Core/Misc): Update attributes to blizzlike

* Revert "refactor(Core/Misc): Update attributes to blizzlike"

This reverts commit ffc5dfc19e740b4a8396972a24ebfd1d8fc4bbc0.

* fix(Core/Spell): Remove ErrorCube visual

* cherry-pick https://github.com/trinitycore/trinitycore/commit/3b5014fdae

* cherry-pick small part of f4f7e6324d

Co-Authored-By: Shauren <shauren.trinity@gmail.com>
Co-Authored-By: Treeston <14020072+treeston@users.noreply.github.com>

* Revert "fix(Core/Spell): Remove ErrorCube visual"

This reverts commit 52ff8915dfda9c905a4094e8974b73bbc21e8eab.

* chore(ci): Upgrade MySQL ver on Windows build

* Revert "chore(ci): Upgrade MySQL ver on Windows build"

This reverts commit 3b111997308671ffa090671c0bc8aadbf3ecd05e.

* fix(DB/Auth): Possible collation error

* Update docker_build.yml

Co-authored-by: Gildor <521036+Jildor@users.noreply.github.com>
Co-authored-by: Shauren <shauren.trinity@gmail.com>
Co-authored-by: Treeston <14020072+treeston@users.noreply.github.com>
2021-10-13 20:00:41 -07:00

108 lines
3.7 KiB
YAML

name: docker-build
on:
push:
branches:
- 'master'
pull_request:
concurrency:
group: ${{ github.head_ref }} || concat(${{ github.ref }}, ${{ github.workflow }})
cancel-in-progress: true
jobs:
docker-build-n-deploy:
strategy:
fail-fast: true
matrix:
os: [ubuntu-20.04]
runs-on: ${{ matrix.os }}
if: github.repository == 'azerothcore/azerothcore-wotlk' && ${{ github.event.label.name == 'run-build' }}
env:
COMPOSE_DOCKER_CLI_BUILD: 1
DOCKER_BUILDKIT: 1
BUILDKIT_INLINE_CACHE: 1
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- uses: actions/checkout@v2
- name: Configure
run: |
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/share/dotnet
docker --version
docker-compose --version
# TODO: make it work
# - uses: whoan/docker-build-with-cache-action@v5
# with:
# image_tag: master
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# compose_file: docker-compose.yml
- name: Login to Docker Hub
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# before cache
# needed to avoid ccache injected into these images
- name: Build Dev
if: github.repository == 'azerothcore/azerothcore-wotlk'
env:
#DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
DOCKER_EXTENDS_BIND: abstract-no-bind
DOCKER_CLIENT_TIMEOUT: 400
COMPOSE_HTTP_TIMEOUT: 400
run: |
export DOCKER_USER_ID=$(id -u)
export DOCKER_GROUP_ID=$(id -u)
docker-compose --profile dev --profile local build --parallel
- name: Deploy Dev
#env:
# DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
run: |
docker-compose --profile dev --profile local push
- name: Cache
uses: actions/cache@v2
with:
path: var/docker/ccache
key: ccache:${{ matrix.os }}:clang:without-modules:${{ github.ref }}:${{ github.sha }}
restore-keys: |
ccache:${{ matrix.os }}:clang:without-modules:${{ github.ref }}
ccache:${{ matrix.os }}:clang:without-modules
- name: Build Production images
if: github.repository == 'azerothcore/azerothcore-wotlk'
env:
#DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
DOCKER_EXTENDS_BIND: abstract-no-bind
DOCKER_AC_BUILD_TARGET: build
DOCKER_CLIENT_TIMEOUT: 220
COMPOSE_HTTP_TIMEOUT: 220
run: |
export DOCKER_USER_ID=$(id -u)
export DOCKER_GROUP_ID=$(id -u)
docker-compose --profile build --profile prod build --parallel
docker-compose run --no-deps --name build ac-build echo "image created"
docker cp build:/azerothcore/var/ccache var/docker/
echo "ccache exported"
- name: Deploy Production images
#env:
# DOCKER_IMAGE_TAG: ${{ steps.extract_branch.outputs.branch }}
if: github.repository == 'azerothcore/azerothcore-wotlk' && steps.extract_branch.outputs.branch == 'master'
run: |
docker-compose --profile prod push