Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Target multiple architectures (follow-up to #28) #31

Merged
merged 10 commits into from
Aug 3, 2020
20 changes: 0 additions & 20 deletions .github/workflows/dockerimage.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/publish.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run tests and deploy image
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install goss and dgoss
uses: e1himself/goss-installation-action@v1
with:
# Goss release version to install
version: "v0.3.13"
- name: Checkout code
uses: actions/checkout@v2
- name: Build the x86_64 Docker image
uses: docker/build-push-action@v1.1.0
with:
push: false
repository: hyzual/koel
tags: latest
- name: Run goss tests on x86_64 image
run: dgoss run hyzual/koel:latest
- name: Build and push production image
uses: zmingxie/docker_buildx@v1.1
with:
publish: true
imageName: hyzual/koel
tag: latest
dockerHubUser: ${{ secrets.DOCKER_HUB_USERNAME }}
dockerHubPassword: ${{ secrets.DOCKER_HUB_PASSWORD }}
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Run tests
on:
pull_request:
push:
branches-ignore: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install goss and dgoss
uses: e1himself/goss-installation-action@v1
with:
# Goss release version to install
version: "v0.3.13"
- name: Checkout code
uses: actions/checkout@v2
- name: Build the x86_64 Docker image
uses: docker/build-push-action@v1.1.0
with:
push: false
repository: hyzual/koel
tags: test
- name: Run goss tests on x86_64 image
run: dgoss run hyzual/koel:test
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ FROM alpine:3.12.0 as front-builder

# Add nodejs and yarn. bash and the other 8 deps are needed to build pngquant, which is a dev dependency for koel...
RUN apk add --no-cache nodejs \
python3 bash lcms2-dev libpng-dev gcc g++ make autoconf automake \
python2 python3 bash lcms2-dev libpng-dev gcc g++ make autoconf automake \
yarn

# Copy sources from php builder
Expand All @@ -52,7 +52,7 @@ COPY --from=php-builder /tmp/koel /tmp/koel
# Install, build frontend assets and then delete the sources to save disk space
RUN cd /tmp/koel/resources/assets && \
# Skip cypress download and installation. It is not needed for a production image
yarn install --non-interactive && \
yarn install --non-interactive --network-timeout 100000 && \
cd /tmp/koel/ && \
CYPRESS_INSTALL_BINARY=0 yarn install --non-interactive && \
yarn run production && \
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

all: build-docker-image

build-docker-image: ## Builds the production Docker build-docker-image
build-docker-image: ## Builds the production x86_64 Docker image
docker build . --file Dockerfile --tag hyzual/koel-dev:latest

build-all-arch-docker-images: ## Builds the production Docker image for all supported processor architectures
docker buildx build --platform linux/amd64,linux/arm/v7,linux/arm64 . --file Dockerfile --tag hyzual/koel-dev:latest

dgoss-ci: ## Run goss tests on the production Docker image
dgoss run hyzual/koel-dev:latest

Expand Down