feat: update docker and pipeline

- Add workflow to publish to GHCR
- Add workflow to build Docker image
- Add zap2xmlrc config example
- Update Dockerfile to run continuously
This commit is contained in:
Jef LeCompte
2019-09-04 12:13:56 -04:00
commit e31071bda8
15 changed files with 1805 additions and 0 deletions

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @jef

2
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,2 @@
github: jef
custom: ["https://www.paypal.me/jxf"]

27
.github/ISSUE_TEMPLATE/bug-remote.md vendored Normal file
View File

@@ -0,0 +1,27 @@
---
name: 🐛 Bug report
about: Report a bug for this project
---
## Expected Behavior
<!-- Tell us what should happen -->
## Current Behavior
<!-- Tell us what happens instead of the expected behavior -->
## Steps to Reproduce
<!-- Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. -->
<!-- Include code to reproduce, if relevant -->
## Environment
- OS:
</details>
## Logs
<!-- Provide a brief log -->

View File

@@ -0,0 +1,12 @@
---
name: 🚀 Feature request
about: Suggest a new idea
---
### Description
<!-- Describe the feature here. -->
### Possible solution
<!-- Describe the possible solution here. -->

19
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,19 @@
<!-- Please use Conventional Commits to label your title -->
<!-- https://www.conventionalcommits.org/en/v1.0.0/ -->
<!-- Example: feat: allow provided config object to extend other configs -->
### Description
<!-- Fixes #(issue) -->
<!-- Please also include relevant motivation and context. -->
### Testing
<!-- Please describe the tests that you ran to verify your changes. -->
<!-- Provide instructions so we can reproduce. -->
<!-- Please also list any relevant details for your test configuration -->
### New dependencies
<!-- List any dependencies that are required for this change. -->
<!-- Otherwise, delete section. -->

14
.github/workflows/ci.yaml vendored Normal file
View File

@@ -0,0 +1,14 @@
name: Continuous Integration
on:
pull_request:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build service
run: docker build .

23
.github/workflows/nightly-release.yaml vendored Normal file
View File

@@ -0,0 +1,23 @@
name: Nightly Release
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch: {}
jobs:
build-release:
name: Build and release Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Login into GitHub Container Registry
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Build Docker image
run: |
docker build \
-t "ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_SHA:0:7}" \
-t "ghcr.io/${GITHUB_REPOSITORY}:nightly" .
- name: Release Docker image
run: |
docker push "ghcr.io/${GITHUB_REPOSITORY}:${GITHUB_SHA:0:7}"
docker push "ghcr.io/${GITHUB_REPOSITORY}:nightly"

34
.github/workflows/release.yaml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: Release
on:
push:
branches:
- main
jobs:
build-tag-release:
name: Build, tag, and release Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup release please
uses: google-github-actions/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
changelog-path: CHANGELOG.md
package-name: zap2xml
- name: Login into GitHub Container Registry
if: ${{ steps.release.outputs.release_created }}
run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Build Docker image
if: ${{ steps.release.outputs.release_created }}
run: |
docker build \
-t "ghcr.io/${GITHUB_REPOSITORY}:${{ steps.release.outputs.tag_name }}" \
-t "ghcr.io/${GITHUB_REPOSITORY}:latest" .
- name: Release Docker image
if: ${{ steps.release.outputs.release_created }}
run: |
docker push "ghcr.io/${GITHUB_REPOSITORY}:${{ steps.release.outputs.tag_name }}"
docker push "ghcr.io/${GITHUB_REPOSITORY}:latest"