diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 6572081..3a06436 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -1,35 +1,43 @@ -# This workflow will build the Container and push a corresponding Docker image to Dockerhub -name: Push docker image to Dockerhub +# This workflow will build the Container and push a corresponding Docker image to the GitHub registry +name: Push docker image to the GitHub registry on: push: branches: propUi tags: - "v*.*.*" + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: multi: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set output - id: vars - run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} + uses: docker/setup-qemu-action@v2 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/setup-buildx-action@v2 + - name: Login to the GitHub registry + uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_ACCESS_TOKEN }} - + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push latest Container - if: ${{ steps.vars.outputs.tag == 'propUi' }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v4 with: context: . + platforms: linux/amd64 #,linux/arm64 push: true - tags: opentosca/bowie:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index a0522b4..c1a61a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,9 @@ FROM node:12.7-alpine AS build WORKDIR /usr/src/app COPY package.json package-lock.json ./ +RUN apk add --no-cache python2 +RUN apk add --no-cache make +RUN apk add --no-cache g++ RUN npm install COPY . . RUN npm run build