Skip to content

Commit

Permalink
organized workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
point-c committed Aug 8, 2024
1 parent 8c8f975 commit c8b45d6
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Coverage

on:
workflow_run:
workflows: [Tests]
branches: [main]
types:
- completed

jobs:
tests-passed:
runs-on: ubuntu-latest
if: |
${{ github.event.workflow_run.conclusion == 'success' }} &&
github.event_name == 'push'
steps:
- name: Coverage report
uses: ncruces/go-coverage-report@v0.3.0
with:
chart: true
amend: true
17 changes: 15 additions & 2 deletions .github/workflows/docker.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ name: Create and publish a Docker image

# Configures this workflow to run every time a change is pushed to the branch called `release`.
on:
push:
branches: ['main']
workflow_run:
workflows: [Tests]
branches: [main]
types:
- completed

# Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds.
env:
Expand All @@ -15,6 +18,9 @@ env:
jobs:
build-and-push-image:
runs-on: ubuntu-latest
if: |
${{ github.event.workflow_run.conclusion == 'success' }} &&
github.event_name == 'push'
# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
Expand All @@ -25,6 +31,13 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
# increment version
- name: Get next version
uses: reecetech/version-increment@2024.4.3
id: version
with:
scheme: semver
increment: patch
# Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that will publish the packages. Once published, the packages are scoped to the account defined here.
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go
name: Tests

on:
push:
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM caddy:2.7.6-builder AS builder

RUN xcaddy build \
--with github.com/point-c/caddy/module@v0.1.2
FROM caddy:2.7.6

COPY --from=builder /usr/bin/caddy /usr/bin/caddy

0 comments on commit c8b45d6

Please sign in to comment.