Repository navigation
Add publish_staging_images workflow #66
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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,95 @@ | ||
| name: Publish staging images | ||
|
|
||
| on: | ||
| push: | ||
| branches: [staging-a, staging-b] | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: staging-${{ github.ref_name }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| HARBOR_REGISTRY: docker-registry.ebrains.eu | ||
| DOCKER_BUILDKIT: 1 | ||
| DOCKER_CLIENT_TIMEOUT: 300 | ||
| COMPOSE_HTTP_TIMEOUT: 300 | ||
| RETRY_ATTEMPTS: "4" | ||
| RETRY_SLEEP: "10" | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build PLATFORM-UI staging image and push to Docker Hub | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| tag: ${{ steps.tag.outputs.tag }} | ||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 #v7.0.1 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 #v4.4.1 | ||
|
|
||
| - name: Harbor connectivity probe | ||
| run: | | ||
| set -x | ||
| getent hosts ${{ env.HARBOR_REGISTRY }} || true | ||
| curl -vI --connect-timeout 10 https://${{ env.HARBOR_REGISTRY }}/v2/ || true | ||
|
|
||
| - name: Disable IPv6 (job-scoped) | ||
| run: | | ||
| sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 | ||
| sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 | ||
|
|
||
| - name: Log in to Docker Hub | ||
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f #v4.6.0 | ||
| with: | ||
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
|
||
| - name: Load PLATFORM-UI service cached image | ||
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 #v6.1.0 | ||
| with: | ||
| path: /tmp/.buildx-cache/platform-ui | ||
| key: ${{ runner.os }}-buildx-platform-ui-${{ hashFiles('Dockerfile', 'nginx.conf.template', 'package.json', 'package-lock.json', 'angular.json', 'src/**', 'public/**') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-buildx-platform-ui- | ||
|
|
||
| - name: Build PLATFORM-UI docker image | ||
| uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc #v7.4.0 | ||
| with: | ||
| context: . | ||
| file: ./Dockerfile | ||
| push: true | ||
| tags: hbpmip/platform-ui:${{ github.ref_name }}-${{ github.sha:0:7 }} | ||
| cache-from: type=local,src=/tmp/.buildx-cache/platform-ui | ||
| cache-to: type=local,dest=/tmp/.buildx-cache-new/platform-ui | ||
|
|
||
| - name: Move Docker images cache | ||
| run: | | ||
| rm -rf /tmp/.buildx-cache | ||
| mv /tmp/.buildx-cache-new /tmp/.buildx-cache | ||
|
|
||
| - name: Output staging tag | ||
| id: tag | ||
| env: | ||
| REF_NAME: ${{ github.ref_name }} | ||
| SHORT_SHA: ${{ github.sha:0:7 }} | ||
| run: | | ||
| echo "tag=${REF_NAME}-${SHORT_SHA}" >> "$GITHUB_OUTPUT" | ||
| echo "Staging image tag: ${REF_NAME}-${SHORT_SHA}" | ||
|
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| bump: | ||
| name: Bump staging image tag in mip | ||
| needs: build | ||
| uses: Medical-Informatics-Platform/mip/.github/workflows/bump-staging-image.yml@master | ||
| permissions: | ||
| contents: read | ||
| with: | ||
| branch: ${{ github.ref_name }} | ||
| key: platform-ui.image.tag | ||
| tag: ${{ needs.build.outputs.tag }} | ||
| secrets: | ||
| app-id: ${{ secrets.STAGING_BUMP_APP_ID }} | ||
| private-key: ${{ secrets.STAGING_BUMP_APP_PRIVATE_KEY }} | ||
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.