-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from actionshub/reuseable-workflows
feat: Update to reusable workflows
- Loading branch information
Showing
9 changed files
with
64 additions
and
75 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,37 +1,9 @@ | ||
--- | ||
name: Publish container | ||
'on': | ||
release: | ||
types: [published] | ||
name: Build & Publish container | ||
"on": | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Publish to GitHub Container Registry | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
steps: | ||
- name: Get the tag version | ||
id: get_tag | ||
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} | ||
|
||
- name: Code checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: linux/amd64 | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository }}:${{ steps.get_tag.outputs.VERSION }} | ||
ghcr.io/${{ github.repository }}:latest | ||
publish: | ||
uses: actionshub/reusable-workflows/.github/workflows/publish.yaml@cce19fb345836ccd29168d876a8a8eca454fb27a |
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 @@ | ||
--- | ||
name: Build & Publish container | ||
"on": | ||
pull_request: | ||
|
||
jobs: | ||
pull_request: | ||
uses: actionshub/reusable-workflows/.github/workflows/pull_request.yaml@cce19fb345836ccd29168d876a8a8eca454fb27a |
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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
FROM ruby:3.1-alpine | ||
FROM ruby:3.2.1-alpine3.17 | ||
|
||
LABEL "com.github.actions.name"="Publish Gem to Rubygems" \ | ||
"com.github.actions.icon"="edit-3" \ | ||
"com.github.actions.color"="red" \ | ||
"com.github.actions.description"="Build and publish your gem to Rubygems" | ||
COPY --chmod=750 entrypoint.sh / | ||
COPY Gemfile Gemfile.lock / | ||
|
||
RUN apk add --no-cache git | ||
RUN gem install bundler keycutter | ||
COPY entrypoint.sh / | ||
ENTRYPOINT [ "/entrypoint.sh" ] | ||
RUN apk add --no-cache git \ | ||
&& bundle install | ||
|
||
ENTRYPOINT ["/entrypoint.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,3 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'keycutter', '= 1.0.2' |
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,13 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
keycutter (1.0.2) | ||
|
||
PLATFORMS | ||
arm64-darwin-22 | ||
|
||
DEPENDENCIES | ||
keycutter (= 1.0.2) | ||
|
||
BUNDLED WITH | ||
2.4.1 |
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 |
---|---|---|
@@ -1,3 +1,24 @@ | ||
# publish-gem-to-rubygems | ||
|
||
A GitHub Action to publish a RubyGem to RubyGems.org | ||
|
||
This Action has been heavily influenced by [Jstastny's Publish-Gem-to-Github Action](https://github.com/jstastny/publish-gem-to-github). | ||
|
||
## Usage | ||
|
||
See [RubyGems API Key scopes][key] on how to obtain an api key | ||
|
||
```yaml | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build and publish to RubyGems | ||
uses: actionshub/publish-gem-to-rubygems@main | ||
with: | ||
api_key: ${{ secrets.RUBY_GEMS_API_KEY }} | ||
``` | ||
[key]: https://guides.rubygems.org/api-key-scopes/ |
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