Remove build-sorybook from build step, it's too long #15
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
name: ci | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
actions: read | |
contents: write | |
pages: write | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: InseeFrLab/onyxia@gh-actions | |
with: | |
action_name: checkout | |
sub_directory: web | |
- uses: actions/[email protected] | |
- uses: bahmutov/[email protected] | |
- run: yarn build | |
- run: npx keycloakify | |
env: | |
XDG_CACHE_HOME: "/home/runner/.cache/yarn" | |
prepare_release: | |
needs: test | |
runs-on: ubuntu-latest | |
outputs: | |
new_web_docker_image_tags: ${{steps._.outputs.new_web_docker_image_tags}} | |
new_chart_version: ${{steps._.outputs.new_chart_version}} | |
release_name: ${{steps._.outputs.release_name}} | |
release_body: ${{steps._.outputs.release_body}} | |
release_tag_name: ${{steps._.outputs.release_tag_name}} | |
target_commit: ${{steps._.outputs.target_commit}} | |
steps: | |
# NOTE: The code for this action is in the gh-actions branch of this repo | |
- uses: InseeFrLab/onyxia@gh-actions | |
id: _ | |
with: | |
action_name: prepare_release | |
publish_web_docker_image: | |
runs-on: ubuntu-latest | |
needs: prepare_release | |
if: needs.prepare_release.outputs.new_web_docker_image_tags != '' | |
steps: | |
- uses: InseeFrLab/onyxia@gh-actions | |
with: | |
action_name: checkout | |
sub_directory: web | |
sha: ${{needs.prepare_release.outputs.target_commit}} | |
- uses: docker/[email protected] | |
- uses: docker/[email protected] | |
- uses: docker/[email protected] | |
with: | |
username: ${{secrets.DOCKERHUB_USERNAME}} | |
password: ${{secrets.DOCKERHUB_TOKEN}} | |
- uses: docker/[email protected] | |
with: | |
push: true | |
context: . | |
tags: ${{needs.prepare_release.outputs.new_web_docker_image_tags}} | |
build-args: CHART_VERSION=${{needs.prepare_release.outputs.new_chart_version}} | |
release: | |
runs-on: ubuntu-latest | |
needs: prepare_release | |
if: needs.prepare_release.outputs.new_chart_version != '' | |
steps: | |
- uses: InseeFrLab/onyxia@gh-actions | |
with: | |
action_name: checkout | |
sub_directory: web | |
sha: ${{needs.prepare_release.outputs.target_commit}} | |
- uses: actions/[email protected] | |
- uses: bahmutov/[email protected] | |
- run: yarn build | |
- run: npx keycloakify | |
env: | |
XDG_CACHE_HOME: "/home/runner/.cache/yarn" | |
KEYCLOAKIFY_THEME_VERSION: ${{needs.prepare_release.outputs.new_chart_version}} | |
- run: mv build_keycloak/target/*.jar keycloak-theme.jar | |
- uses: yogeshlonkar/[email protected] | |
with: | |
ignore-skipped: true | |
jobs: publish_web_docker_image | |
ttl: 10 | |
- uses: InseeFrLab/onyxia@gh-actions | |
with: | |
action_name: release_helm_chart | |
sha: ${{needs.prepare_release.outputs.target_commit}} | |
- uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{needs.prepare_release.outputs.release_name}} | |
body: ${{needs.prepare_release.outputs.release_body}} | |
tag_name: ${{needs.prepare_release.outputs.release_tag_name}} | |
target_commitish: ${{needs.prepare_release.outputs.target_commit}} | |
generate_release_notes: true | |
files: | | |
keycloak-theme.jar | |
onyxia-${{needs.prepare_release.outputs.new_chart_version}}.tgz | |
env: | |
# NOTE: We can't use github.token because it would not tirgger the dispatch workflow. | |
GITHUB_TOKEN: ${{secrets.MY_GITHUB_TOKEN}} |