-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: switch to Guthub Actions
- Loading branch information
Showing
5 changed files
with
144 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# EditorConfig is awesome: https://EditorConfig.org | ||
|
||
# top-most EditorConfig file | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
# Set default charset | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
charset = utf-8 | ||
|
||
[*.{yaml,yml,sh}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[Dockerfile] | ||
indent_style = tab | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
updates: | ||
# Maintain dependencies for GitHub Actions | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
- mainline | ||
tags-ignore: | ||
- v* | ||
|
||
env: | ||
IMAGE_NAME: nginx-brotli | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/[email protected] | ||
|
||
- name: Build amd64 image | ||
uses: docker/[email protected] | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
platforms: linux/amd64 | ||
push: false | ||
tags: ${{ env.IMAGE_NAME }} | ||
load: true | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
||
- name: Test | ||
run: | | ||
docker run --rm -v $(pwd)/tests.sh:/tests.sh --entrypoint sh nginx-brotli /tests.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
--- | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- mainline | ||
tags: | ||
- v* | ||
|
||
env: | ||
IMAGE_NAME: nginx-brotli | ||
|
||
jobs: | ||
build-test-and-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=raw,priority=1000,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} | ||
type=raw,priority=1000,value=mainline-latest,enable=${{ github.ref == 'refs/heads/mainline' }} | ||
type=match,priority=600,pattern=^(v\d+\.\d+\.\d+)$,group=0 | ||
- name: Set up QEMU | ||
uses: docker/[email protected] | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/[email protected] | ||
|
||
- name: Build amd64 image | ||
uses: docker/[email protected] | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
platforms: linux/amd64 | ||
push: false | ||
tags: ${{ steps.meta.outputs.tags }} | ||
load: true | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache | ||
|
||
- name: List images | ||
run: | | ||
docker images | ||
- name: Test | ||
run: | | ||
docker run --rm -v $(pwd)/tests.sh:/tests.sh --entrypoint sh nginx-brotli /tests.sh | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
if: github.event_name != 'pull_request' | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
|
||
- name: Build amd64 image | ||
uses: docker/[email protected] | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
platforms: linux/amd64,linux/arm64,linux/ppc64le | ||
push: false | ||
tags: ${{ env.IMAGE_NAME }} | ||
load: true | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters