Files
bake-action/.dev/release.yml
2020-10-08 00:52:52 +02:00

88 lines
2.0 KiB
YAML

name: release
on:
create
on:
push:
branches:
- releases/*
paths:
- src/*
jobs:
release:
runs-on: ubuntu-18.04
steps:
-
name: Checkout
uses: actions/checkout@v1
with:
ref: remotes/origin/releases/v1
-
name: Git checkout
run: git checkout -b releases/v1
-
name: Install
run: npm install
-
name: Build
run: npm run build
-
name: Not ignore node_modules
run: sed -i '/node_modules*/d' .gitignore
-
name: Install production deps
run: |
rm -rf node_modules
npm install --production
-
name: Setup Git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
-
name: Git commit
run: |
git add -A
DIFF=`git diff --cached --numstat | wc -l`
if [ $DIFF -eq 0 ]; then
exit 0
fi
git commit -am 'Build for release'
-
name: Git push
run: git push origin HEAD
check:
runs-on: ubuntu-18.04
needs: release
strategy:
matrix:
version:
- latest
- v0.2.2
steps:
-
name: Checkout
uses: actions/checkout@v1
-
name: Set up Docker Buildx
id: buildx
uses: crazy-max/ghaction-docker-buildx@releases/v1
with:
version: ${{ matrix.version }}
-
name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
-
name: Run Buildx
run: |
docker buildx build \
--platform linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/s390x \
--output "type=image,push=false" \
--file ./test/Dockerfile ./test