-
Notifications
You must be signed in to change notification settings - Fork 5
Docker Publishing and other workflow updates #681
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
Open
Zeitsperre
wants to merge
15
commits into
master
Choose a base branch
from
docker-deployment
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 7 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
0ea8d3a
set permissions, use hashes of commits
Zeitsperre e05b432
update Dockerfile metadata, use bump-my-version
Zeitsperre 7f5714c
fix replacement, adjust handling of names
Zeitsperre 76cff6a
update RTD ubuntu version
Zeitsperre 19154ed
add cooldowns
Zeitsperre f5050b8
add docker-publish workflow
Zeitsperre 5a72cfe
Merge branch 'master' into docker-deployment
Zeitsperre 616471b
add docker-testing.yml, specify master branch
Zeitsperre ae94e97
add label inspection step
Zeitsperre 8a95670
better image name handling and metadata for testing
Zeitsperre df6a943
re-add checkout
Zeitsperre c529b34
supply labels
Zeitsperre abf0f0c
add revision
Zeitsperre 675914a
use sha of originating commit
Zeitsperre 92b68c4
remove hooks
Zeitsperre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,58 @@ | ||
| [tool.bumpversion] | ||
| current_version = "5.1.1" | ||
| commit = true | ||
| tag = true | ||
| tag_name = "{new_version}" | ||
|
|
||
| [[tool.bumpversion.files]] | ||
| filename = "Dockerfile" | ||
| search = "LABEL org.opencontainers.image.version=\"{current_version}\"" | ||
| replace = "LABEL org.opencontainers.image.version=\"{new_version}\"" | ||
|
|
||
| [[tool.bumpversion.files]] | ||
| filename = "Dockerfile" | ||
| search = "LABEL org.opencontainers.image.created=\"\\d{{4}}-\\d{{2}}-\\d{{2}}T\\d{{2}}:\\d{{2}}:\\d{{2}}Z\"" | ||
| replace = "LABEL org.opencontainers.image.created=\"{utcnow:%Y-%m-%dT%H:%M:%SZ}\"" | ||
| regex = true | ||
|
|
||
| [[tool.bumpversion.files]] | ||
| filename = "Dockerfile.adapter" | ||
| search = "LABEL org.opencontainers.image.version=\"{current_version}\"" | ||
| replace = "LABEL org.opencontainers.image.version=\"{new_version}\"" | ||
|
|
||
| [[tool.bumpversion.files]] | ||
| filename = "Dockerfile.adapter" | ||
| search = "LABEL org.opencontainers.image.created=\"\\d{{4}}-\\d{{2}}-\\d{{2}}T\\d{{2}}:\\d{{2}}:\\d{{2}}Z\"" | ||
| replace = "LABEL org.opencontainers.image.created=\"{utcnow:%Y-%m-%dT%H:%M:%SZ}\"" | ||
| regex = true | ||
|
|
||
| [[tool.bumpversion.files]] | ||
| filename = "README.rst" | ||
| search = "{current_version}" | ||
| replace = "{new_version}" | ||
|
|
||
| [[tool.bumpversion.files]] | ||
| filename = "Makefile" | ||
| search = "APP_VERSION ?= {current_version}" | ||
| replace = "APP_VERSION ?= {new_version}" | ||
|
|
||
| [[tool.bumpversion.files]] | ||
| filename = "magpie/__meta__.py" | ||
| search = "__version__ = \"{current_version}\"" | ||
| replace = "__version__ = \"{new_version}\"" | ||
|
|
||
| [[tool.bumpversion.files]] | ||
| filename = "CHANGES.rst" | ||
| search = """ | ||
| `Unreleased <https://github.com/Ouranosinc/Magpie/tree/master>`_ (latest) | ||
| ------------------------------------------------------------------------------------""" | ||
| replace = """ | ||
| `Unreleased <https://github.com/Ouranosinc/Magpie/tree/master>`_ (latest) | ||
| ------------------------------------------------------------------------------------ | ||
|
|
||
| * Nothing new for the moment. | ||
|
|
||
| .. _changes_{new_version}: | ||
|
|
||
| `{new_version} <https://github.com/Ouranosinc/Magpie/tree/{new_version}>`_ ({now:%%Y-%%m-%%d}) | ||
| ------------------------------------------------------------------------------------""" |
This file contains hidden or 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 hidden or 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,117 @@ | ||
| name: Docker Hub Publishing | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - "master" | ||
| paths: | ||
| - ".bumpversion.toml" | ||
| - "Dockerfile" | ||
| - "Dockerfile.adapter" | ||
| tags: | ||
| - "[0-9]+.[0-9]+.[0-9]+" | ||
|
|
||
| concurrency: | ||
| # For a given workflow, if we push to the same branch, cancel all previous builds on that branch except on master. | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.ref == 'refs/heads/main' }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build-publish-magpie: | ||
| name: Build and publish (Magpie) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 | ||
| with: | ||
| disable-sudo: true | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout Repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Gather Docker metadata | ||
| id: meta | ||
| uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 | ||
| with: | ||
| images: pavics/magpie | ||
| labels: | | ||
| org.opencontainers.image.authors=Francis Charette-Migneault <francis.charette-migneault@crim.ca> | ||
| org.opencontainers.image.description=Runs Magpie AuthN/AuthZ service for REST-API and UI interfaces. | ||
| org.opencontainers.image.licenses=Apache-2.0 | ||
| org.opencontainers.image.title=Magpie | ||
| org.opencontainers.image.vendor=CRIM and Ouranosinc | ||
| tags: | | ||
| type=raw,value=latest,enable={{is_default_branch}} | ||
| type=ref,event=tag | ||
| type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }} | ||
|
|
||
| - name: Login to Docker Hub | ||
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | ||
|
|
||
| - name: Build Docker image and publish to Docker Hub | ||
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | ||
| with: | ||
| file: Dockerfile | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
|
|
||
| build-publish-twitcher: | ||
| name: Build and publish (twitcher w/MagpieAdapter) | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 | ||
| with: | ||
| disable-sudo: true | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout Repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Gather Docker metadata | ||
| id: meta | ||
| uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0 | ||
| with: | ||
| images: pavics/twitcher | ||
| labels: | | ||
| org.opencontainers.image.authors=Francis Charette-Migneault <francis.charette-migneault@crim.ca> | ||
| org.opencontainers.image.description=Configures MagpieAdapter on top of Twitcher application. | ||
| org.opencontainers.image.licenses=Apache-2.0 | ||
| org.opencontainers.image.title=Twitcher with MagpieAdapter | ||
| org.opencontainers.image.vendor=CRIM and Ouranosinc | ||
| tags: | | ||
| type=raw,value=latest,enable={{is_default_branch}},prefix=magpie- | ||
| type=ref,event=tag,prefix=magpie- | ||
| type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }},prefix=magpie- | ||
|
|
||
| - name: Login to Docker Hub | ||
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 | ||
|
|
||
| - name: Build Docker image and publish to Docker Hub | ||
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7.3.0 | ||
| with: | ||
| file: Dockerfile.adapter | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| push: true | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
This file contains hidden or 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,18 +1,27 @@ | ||
| name: Greetings | ||
|
|
||
| on: [pull_request, issues] | ||
| on: | ||
| - pull_request | ||
| - issues | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| greeting: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/first-interaction@v3 | ||
| - name: Greet Contributor | ||
| uses: actions/first-interaction@1c4688942c71f71d4f5502a26ea67c331730fa4d # v3.1.0 | ||
| with: | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
| issue-message: > | ||
| issue_message: > | ||
| Thanks for submitting an issue. Make sure you have checked for similar issues. | ||
| Also, provide enough details for us to be able to replicate the problem. | ||
| pr-message: > | ||
| pr_message: > | ||
| Thanks for submitting a PR. Make sure you have looked at the contribution guidelines. | ||
| Also, look for quick check/tests operations that you can run locally for early verification of errors. | ||
| Travis will be happier if it doesn't need to run too many times with problematic code. |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.