mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: Docker CI
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
jobs:
|
|
buildx:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Use Node.js 14.x
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14.x
|
|
|
|
- name: NPM Install
|
|
run: |
|
|
npm install
|
|
|
|
- name: NPM Lint
|
|
run: |
|
|
npm run lint
|
|
|
|
- name: NPM Build
|
|
id: npm-build
|
|
run: |
|
|
npm run build
|
|
echo "::set-output name=version::$(grep '"version":' package.json -m1 | cut -d\" -f4)"
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
# Docker Username and Password have to be set as secrets in GitHub repo.
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
password: ${{ secrets.DOCKER_TOKEN }}
|
|
|
|
- name: Build and push base-image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: docker/Dockerfile
|
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
|
push: true
|
|
tags: |
|
|
coderaiser/cloudcmd:latest
|
|
coderaiser/cloudcmd:${{ steps.npm-build.outputs.version }}
|
|
|
|
- name: Build and push alpine-image
|
|
uses: docker/build-push-action@v2
|
|
with:
|
|
context: .
|
|
file: docker/Dockerfile.alpine
|
|
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
|
push: true
|
|
tags: |
|
|
coderaiser/cloudcmd:latest-alpine
|
|
coderaiser/cloudcmd:${{ steps.npm-build.outputs.version }}-alpine
|