Skip to content

Commit

Permalink
Merge branch 'release/0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
nwtgck committed Mar 30, 2022
2 parents e544a83 + cb00315 commit 51fbcec
Show file tree
Hide file tree
Showing 17 changed files with 6,474 additions and 846 deletions.
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
timezone: Asia/Tokyo
open-pull-requests-limit: 99
reviewers:
- nwtgck
assignees:
- nwtgck
- package-ecosystem: docker
directory: "/"
schedule:
interval: daily
timezone: Asia/Tokyo
open-pull-requests-limit: 99
reviewers:
- nwtgck
assignees:
- nwtgck
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [8.x, 10.x, 12.x]
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -23,3 +23,20 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build
- run: npm test
- name: migrate config
run: |
set -xeu
npm install -g .
cat <<EOF > "config.yaml"
allowPaths:
- /0s6twklxkrcfs1u
- type: regexp
value: "/[abcd]+"
basicAuthUsers:
- username: user1
password: pass1234
rejection: nginx-down
EOF
rich-piping-server --config-path=./config.yaml migrate-config
45 changes: 30 additions & 15 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Docker
name: Docker push when latest and releases pushed

on:
push:
branches:
- master
- master
release:
types: [published]
schedule:
Expand All @@ -13,16 +13,31 @@ jobs:
build_and_push:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- run: git fetch --unshallow
- name: Build & Push latest version
run: |
export LATEST_TAG=$(ruby -e 'puts ("v" + `git tag`.each_line.map{|l| begin Gem::Version::new(l.sub(/^v/, "")); rescue; nil end}.compact.max.to_s)')
echo "Latest tag: $LATEST_TAG"
git reset --hard $LATEST_TAG
git status
docker build -t nwtgck/rich-piping-server:$LATEST_TAG .
docker tag nwtgck/rich-piping-server:$LATEST_TAG nwtgck/rich-piping-server:latest
echo ${{ secrets.DOCKER_HUB_TOKEN }} | docker login -u nwtgck --password-stdin
docker push nwtgck/rich-piping-server:$LATEST_TAG
docker push nwtgck/rich-piping-server:latest
- uses: actions/checkout@v3
- run: git fetch --unshallow
- name: Get latest tag
id: latest_tag
run: |
ruby -e 'puts "::set-output name=latest_tag::#{`git tag`.each_line.map{|t| begin {raw_tag: t, gver: Gem::Version::new(t.sub(/^v/, ""))}; rescue; nil end}.compact.max_by{|v| v[:gver]}[:raw_tag]}"'
- name: Checkout latest tag
run: |
set -eu
echo "Latest tag: ${{ steps.latest_tag.outputs.latest_tag }}"
git reset --hard ${{ steps.latest_tag.outputs.latest_tag }}
git status
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: nwtgck
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64
push: true
tags: nwtgck/rich-piping-server:latest,nwtgck/rich-piping-server:${{ steps.latest_tag.outputs.latest_tag }}
Loading

0 comments on commit 51fbcec

Please sign in to comment.