Merge pull request #163 from InseeFr/feat/add-unit-test-for-service-w… #62
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: Release Candidate | |
on: | |
push: | |
branches: | |
- 'develop' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- run: yarn | |
- run: yarn build | |
- name: Upload build | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pearl-jam | |
path: build | |
check_if_version_upgraded: | |
needs: build | |
runs-on: ubuntu-latest | |
outputs: | |
is_upgraded_version: ${{ steps.check.outputs.changed }} | |
version: ${{ steps.check.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- name: Check if version has been updated | |
id: check | |
uses: EndBug/version-check@v2 | |
docker: | |
needs: check_if_version_upgraded | |
if: needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/setup-qemu-action@v2 | |
- uses: docker/setup-buildx-action@v2 | |
- uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: pearl-jam | |
path: build | |
- uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
context: . | |
tags: | | |
inseefr/pearl-jam:latest, | |
inseefr/pearl-jam:${{ needs.check_if_version_upgraded.outputs.version }}-rc | |
release: | |
needs: check_if_version_upgraded | |
if: needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
- name: Get current version | |
id: version | |
uses: notiz-dev/github-action-json-property@release | |
with: | |
path: 'package.json' | |
prop_path: 'version' | |
- run: echo ${{steps.version.outputs.prop}} | |
- name: Release snapshot | |
id: release-snapshot | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Release Candidate ${{ needs.check_if_version_upgraded.outputs.version }} | |
tag_name: ${{ needs.check_if_version_upgraded.outputs.version }}-rc | |
target_commitish: ${{ github.head_ref || github.ref }} | |
generate_release_notes: true | |
draft: false | |
prerelease: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |