Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nightly release #43

Merged
merged 1 commit into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions .github/workflows/nightly-build.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Nightly Build

on:
schedule:
- cron: '00 01 * * *'
# schedule:
# - cron: '00 01 * * *'
workflow_dispatch:

permissions:
Expand All @@ -25,9 +25,23 @@ jobs:
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"

docker:
version:
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
name: Repository Version Check
outputs:
version: ${{ steps.version_check.outputs.release_tag }}
steps:
- id: version_check
name: Version check
uses: docker://jackstock8904/version-check:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

docker:
needs: [check_date, version]
if: ${{ needs.check_date.outputs.should_run != 'false' }}
name: Build container and push to DockerHub
runs-on: ubuntu-latest
strategy:
Expand All @@ -36,16 +50,12 @@ jobs:
include:
- name: assignee
image: jackstock8904/assignee
build-args: DIRECTORY=assignee COMMAND=assignee
- name: auth-check
image: jackstock8904/auth-check
build-args: DIRECTORY=auth-check COMMAND=auth-check
- name: close-pr
image: jackstock8904/close-pr
build-args: DIRECTORY=close-pr COMMAND=close-pr
- name: version-check
image: jackstock8904/version-check
build-args: DIRECTORY=version-check COMMAND=version-check
permissions:
contents: read
packages: write
Expand All @@ -54,14 +64,8 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- id: version_check
name: Version check
uses: docker://jackstock8904/version-check:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Output
run: echo ${{steps.version_check.outputs.release_tag}}
run: echo ${{ needs.version.outputs.version }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -81,14 +85,17 @@ jobs:
with:
flavor: latest=false
images: ${{ matrix.image }}
tags: type=semver,suffix=-nightly,pattern={{version}},value=${{ steps.version_check.outputs.release_tag }}
tags: type=semver,suffix=-nightly,pattern={{version}},value=${{ needs.version.outputs.version }}

- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
file: Dockerfile
tags: ${{ steps.metadata.outputs.tags }}
build-args: ${{ matrix.build-args}}
build-args: |
DIRECTORY=${{ matrix.name }}
COMMAND=${{ matrix.name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,49 @@
---
![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/jackstockley89/github-actions?filename=go.mod&style=for-the-badge)


## Workflow Activity
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jackstockley89/github-actions/Release%20Go%20project?label=Release%20Go%20project&style=for-the-badge)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/jackstockley89/github-actions/go-releaser.yaml?label=Release%20Build&style=for-the-badge)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/jackstockley89/github-actions/nightly-build.yaml?label=Nightly%20Build&style=for-the-badge)


## Script Index
---
![Docker Pulls](https://img.shields.io/docker/pulls/jackstock8904/assignee?label=assignee%20docker%20pulls%20&style=for-the-badge)
```

When called this action will assign a github user to a pull request if they are a Collaborator
```

Directory Link: [assignee](https://github.com/jackstockley89/github-actions/tree/main/assignee)

Workflow Example: [README](https://github.com/jackstockley89/github-actions/tree/main/assignee/README.md)

---
![Docker Pulls](https://img.shields.io/docker/pulls/jackstock8904/auth-check?label=auth-check%20docker%20pulls%20&style=for-the-badge)
```

When called this action will compare the user who raised the pull request with the Collaborator list
```

Directory Link: [auth-check](https://github.com/jackstockley89/github-actions/tree/main/auth-check)

Workflow Example: [README](https://github.com/jackstockley89/github-actions/tree/main/auth-check/README.md)

---
![Docker Pulls](https://img.shields.io/docker/pulls/jackstock8904/close-pr?label=close-pr%20docker%20pulls%20&style=for-the-badge)
```

When called this action will close a pull request
```

Directory Link: [close-pr](https://github.com/jackstockley89/github-actions/tree/main/close-pr)

Workflow Example: [README](https://github.com/jackstockley89/github-actions/tree/main/close-pr/README.md)

---
![Docker Pulls](https://img.shields.io/docker/pulls/jackstock8904/version-check?label=version-check%20docker%20pulls&style=for-the-badge)

When called this action will check repository for the latest release tag

Directory Link: [version-check](https://github.com/jackstockley89/github-actions/tree/main/version-check)

---

## How to publish a new binary
---
```
Within this respoistory, the goreleaser tool is used to create a Go binary and push a image to Docker Hub. To publish a new binary once the Pull Request is approved and merged into the main branch, create a new release and the github action will automatically start and publish the new binary. No changes will be needed to the workflow that is calling the image aslong as the latest image is being pulled
```
Within this respoistory, the goreleaser tool is used to create a Go binary and push a image to Docker Hub. To publish a new binary once the Pull Request is approved and merged into the main branch, create a new release and the github action will automatically start and publish the new binary. No changes will be needed to the workflow that is calling the image aslong as the latest image is being pulled