Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit f5deecf

Browse files
author
Antonio Cheong
committed
add auto images build/push
1 parent 616f342 commit f5deecf

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed

.github/stale.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 60
3+
# Number of days of inactivity before a stale issue is closed
4+
daysUntilClose: 7
5+
# Issues with these labels will never be considered stale
6+
exemptLabels:
7+
- pinned
8+
- security
9+
# Label to use when marking an issue as stale
10+
staleLabel: wontfix
11+
# Comment to post when marking an issue as stale. Set to `false` to disable
12+
markComment: >
13+
This issue has been automatically marked as stale because it has not had
14+
recent activity. It will be closed if no further activity occurs. Thank you
15+
for your contributions.
16+
# Comment to post when closing a stale issue. Set to `false` to disable
17+
closeComment: false

.github/workflows/buildx.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: buildx
2+
3+
on:
4+
create:
5+
tags:
6+
- v*
7+
8+
jobs:
9+
buildx:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v2
15+
-
16+
name: Prepare
17+
id: prepare
18+
run: |
19+
DOCKER_IMAGE=windoac/nginx-npm
20+
DOCKER_PLATFORMS=linux/amd64,linux/arm/v7,linux/arm64/v8
21+
VERSION=edge
22+
23+
if [[ $GITHUB_REF == refs/tags/* ]]; then
24+
VERSION=${GITHUB_REF#refs/tags/}
25+
fi
26+
27+
TAGS="--tag ${DOCKER_IMAGE}:${VERSION}"
28+
if [[ $VERSION =~ ^[0-9]{1,3} ]]; then
29+
TAGS="$TAGS --tag ${DOCKER_IMAGE}:latest"
30+
fi
31+
32+
echo ::set-output name=docker_image::${DOCKER_IMAGE}
33+
echo ::set-output name=version::${VERSION}
34+
echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} \
35+
--build-arg VERSION=${VERSION} \
36+
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
37+
--build-arg VCS_REF=${GITHUB_SHA::8} \
38+
${TAGS} --file ./Dockerfile .
39+
# https://github.com/docker/setup-qemu-action
40+
-
41+
name: Set up QEMU
42+
uses: docker/setup-qemu-action@v1
43+
# https://github.com/docker/setup-buildx-action
44+
-
45+
name: Set up Docker Buildx
46+
uses: docker/setup-buildx-action@v1
47+
with:
48+
cache-from: type=gha
49+
cache-to: type=gha,mode=max
50+
-
51+
name: Docker Buildx (build)
52+
run: |
53+
docker buildx build --output "type=image,push=false" ${{ steps.prepare.outputs.buildx_args }}
54+
-
55+
name: Login to DockerHub
56+
if: success() && github.event_name != 'pull_request'
57+
uses: docker/login-action@v1
58+
with:
59+
username: ${{ secrets.DOCKER_USERNAME }}
60+
password: ${{ secrets.DOCKER_PASSWORD }}
61+
-
62+
name: Docker Buildx (push)
63+
if: success() && github.event_name != 'pull_request'
64+
run: |
65+
docker buildx build --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
66+
-
67+
name: Inspect image
68+
if: always() && github.event_name != 'pull_request'
69+
run: |
70+
docker buildx imagetools inspect ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}

.gitignore

Whitespace-only changes.

0 commit comments

Comments
 (0)