Queen v2 upgrade lunatic (#51) #356
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: | |
- "**" | |
pull_request: | |
branches: | |
- "**" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.head_commit.author.name != 'github-actions[bot]' | |
environment: demo | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- run: yarn | |
- name: Copy .env file for drama queen | |
env: | |
VITE_QUEEN_URL: ${{ vars.VITE_QUEEN_URL }} | |
VITE_QUEEN_V2_URL: ${{ vars.VITE_QUEEN_V2_URL }} | |
run: | | |
cp drama-queen/.env drama-queen/.env.build | |
sed -i "s#VITE_QUEEN_URL=#VITE_QUEEN_URL=${VITE_QUEEN_URL}#" drama-queen/.env.build | |
sed -i "s#VITE_QUEEN_V2_URL=#VITE_QUEEN_V2_URL=${VITE_QUEEN_V2_URL}#" drama-queen/.env.build | |
- run: yarn build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: drama | |
path: drama-queen/dist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: queen | |
path: queen/build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: queen-v2 | |
path: queen-v2/build | |
check_if_version_upgraded: | |
needs: build | |
runs-on: ubuntu-latest | |
if: | | |
github.event_name == 'push' && | |
github.ref_name == 'main' | |
outputs: | |
is_upgraded_version: ${{ steps.check.outputs.changed }} | |
version: ${{ steps.check.outputs.version }} | |
is_drama_upgraded_version: ${{ steps.check-drama.outputs.changed }} | |
drama_version: ${{ steps.check-drama.outputs.version }} | |
is_queen_upgraded_version: ${{ steps.check-queen.outputs.changed }} | |
queen_version: ${{ steps.check-queen.outputs.version }} | |
is_queen_v2_upgraded_version: ${{ steps.check-queen-v2.outputs.changed }} | |
queen_v2_version: ${{ steps.check-queen-v2.outputs.version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
- name: Check if container version has been updated | |
id: check | |
uses: EndBug/version-check@v2 | |
- name: Check if drama queen version has been updated | |
id: check-drama | |
uses: EndBug/version-check@v2 | |
with: | |
file-name: drama-queen/package.json | |
- name: Check if queen version has been updated | |
id: check-queen | |
uses: EndBug/version-check@v2 | |
with: | |
file-name: queen/package.json | |
- name: Check if queen-v2 version has been updated | |
id: check-queen-v2 | |
uses: EndBug/version-check@v2 | |
with: | |
file-name: queen-v2/package.json | |
docker_drama: | |
needs: check_if_version_upgraded | |
if: needs.check_if_version_upgraded.outputs.is_drama_upgraded_version == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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: drama | |
path: drama-queen/dist | |
- uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
context: drama-queen | |
push: true | |
tags: | | |
inseefr/drama-queen:latest, | |
inseefr/drama-queen:${{ needs.check_if_version_upgraded.outputs.drama_version }} | |
docker_queen: | |
needs: check_if_version_upgraded | |
if: needs.check_if_version_upgraded.outputs.is_queen_upgraded_version == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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: queen | |
path: queen/build | |
- uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
context: ./queen | |
push: true | |
tags: inseefr/queen:${{ needs.check_if_version_upgraded.outputs.queen_version }} | |
docker_queen_v2: | |
needs: check_if_version_upgraded | |
if: needs.check_if_version_upgraded.outputs.is_queen_v2_upgraded_version == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- 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: queen-v2 | |
path: queen-v2/build | |
- uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
context: ./queen-v2 | |
push: true | |
tags: inseefr/queen:${{ needs.check_if_version_upgraded.outputs.queen_v2_version }} | |
release: | |
runs-on: ubuntu-latest | |
needs: check_if_version_upgraded | |
if: needs.check_if_version_upgraded.outputs.is_upgraded_version == 'true' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.ref }} | |
- uses: softprops/action-gh-release@v1 | |
with: | |
name: Release v${{ needs.check_if_version_upgraded.outputs.version }} | |
tag_name: v${{ needs.check_if_version_upgraded.outputs.version }} | |
target_commitish: ${{ github.head_ref || github.ref }} | |
generate_release_notes: true | |
draft: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |