Skip to content

Commit

Permalink
Build docker with Github Actions (#533)
Browse files Browse the repository at this point in the history
enable actions
  • Loading branch information
nondanee authored May 10, 2020
1 parent 17cddd0 commit b41b3af
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 47 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ npm-debug.log

Dockerfile*
*.yml
hooks/
src/browser/
45 changes: 45 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: publish

on:
push:
tags:
- '*'

jobs:
docker:
runs-on: ubuntu-latest
env:
REPOSITORY: unblockneteasemusic
DOCKER_USERNAME: nondanee
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
steps:
-
name: Prepare
id: prepare
run: |
ARCH=(amd64 arm/v6 arm/v7 arm64 386 ppc64le s390x)
PLATFORM=$(printf ",linux/%s" "${ARCH[@]}")
echo ::set-output name=build_platform::${PLATFORM:1}
echo ::set-output name=image_name::${DOCKER_USERNAME}/${REPOSITORY}
-
name: Checkout
uses: actions/checkout@v2
-
name: Setup Buildx
uses: crazy-max/ghaction-docker-buildx@v1
-
name: Login
run: |
echo "${DOCKER_PASSWORD}" | docker login --username ${DOCKER_USERNAME} --password-stdin
-
name: Build
run: |
docker buildx build \
--tag ${{ steps.prepare.outputs.image_name }} \
--platform ${{ steps.prepare.outputs.build_platform }} \
--output "type=image,push=true" \
--file Dockerfile .
-
name: Check Manifest
run: |
docker buildx imagetools inspect ${{ steps.prepare.outputs.image_name }}
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@

Dockerfile*
*.yml
hooks/
src/browser/
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ARG ARCH="amd64"
FROM multiarch/alpine:$ARCH-latest-stable
FROM alpine
RUN apk add --update nodejs npm --repository=http://dl-cdn.alpinelinux.org/alpine/latest-stable/main/

ENV NODE_ENV production
Expand Down
15 changes: 0 additions & 15 deletions hooks/build

This file was deleted.

20 changes: 0 additions & 20 deletions hooks/post_push

This file was deleted.

4 changes: 0 additions & 4 deletions hooks/pre_build

This file was deleted.

4 changes: 0 additions & 4 deletions hooks/pre_push

This file was deleted.

0 comments on commit b41b3af

Please sign in to comment.