-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Dockerfile and GitHub actions for CI/releases
- Loading branch information
Showing
8 changed files
with
94 additions
and
11 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,14 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "docker" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "bundler" | ||
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,24 @@ | ||
name: "Run CI" | ||
|
||
on: | ||
push: | ||
branches: ["production"] | ||
pull_request: | ||
workflow_call: | ||
|
||
jobs: | ||
test: | ||
runs-on: "ubuntu-latest" | ||
strategy: | ||
matrix: | ||
task: | ||
- "spec" | ||
- "lint" | ||
- "metadata_lint" | ||
- "syntax" | ||
- "rubocop" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
- name: "rake ${{ matrix.task }}" | ||
run: | | ||
docker run --rm `docker build -q .` rake ${{ matrix.task }} |
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,37 @@ | ||
name: "Release to Puppet Forge" | ||
|
||
on: "workflow_dispatch" | ||
|
||
jobs: | ||
test: | ||
uses: "./.github/workflows/ci.yml" | ||
|
||
release: | ||
runs-on: "ubuntu-latest" | ||
needs: "test" | ||
steps: | ||
- uses: "actions/checkout@v4" | ||
- name: "get version" | ||
id: "get_version" | ||
run: | | ||
echo "version=`jq --raw-output .version metadata.json`" >> $GITHUB_OUTPUT | ||
- name: "pdk build" | ||
uses: "docker://puppet/pdk:3.0.0.0" | ||
with: | ||
args: "build" | ||
- name: "gh changelog get --latest" | ||
run: | | ||
export GH_HOST=github.com | ||
gh extension install chelnak/gh-changelog | ||
gh changelog get --latest > OUTPUT.md | ||
env: | ||
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: "gh release create" | ||
run: | | ||
gh release create v${{ steps.get_version.outputs.version }} --title v${{ steps.get_version.outputs.version }} -F OUTPUT.md | ||
env: | ||
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: "pdk publish" | ||
uses: "docker://puppet/pdk:3.0.0.0" | ||
with: | ||
args: "release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force" |
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
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,8 @@ | ||
FROM ruby:3.3 | ||
RUN gem install bundler && mkdir -p /usr/src/app | ||
COPY Gemfile* /usr/src/app | ||
WORKDIR /usr/src/app | ||
RUN bundle install | ||
COPY . /usr/src/app | ||
ENTRYPOINT ["bundle", "exec"] | ||
CMD ["rake", "spec"] |
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
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
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