Configure Renovate #7
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 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.head_commit.author.name != 'github-actions[bot]' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "16" | |
- run: npx lerna bootstrap | |
- run: yarn build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: host | |
path: host/dist | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: remote | |
path: remote/dist | |
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_host_upgraded_version: ${{ steps.check-host.outputs.changed }} | |
host_version: ${{ steps.check-host.outputs.version }} | |
is_remote_upgraded_version: ${{ steps.check-remote.outputs.changed }} | |
remote_version: ${{ steps.check-remote.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 host version has been updated | |
id: check-host | |
uses: EndBug/version-check@v2 | |
with: | |
file-name: host/package.json | |
- name: Check if remote version has been updated | |
id: check-remote | |
uses: EndBug/version-check@v2 | |
with: | |
file-name: remote/package.json | |
docker_host: | |
needs: check_if_version_upgraded | |
if: needs.check_if_version_upgraded.outputs.is_host_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/#-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: host | |
path: host/dist | |
- uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
context: host | |
push: true | |
tags: ddecrulle/workshop-host:latest,${{ needs.check_if_version_upgraded.outputs.host_version }} | |
docker_remote: | |
needs: check_if_version_upgraded | |
if: needs.check_if_version_upgraded.outputs.is_host_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/#-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: remote | |
path: remote/dist | |
- uses: docker/build-push-action@v4 | |
with: | |
platforms: linux/amd64,linux/arm64 | |
context: remote | |
push: true | |
tags: ddecrulle/workshop-remote:latest,${{ needs.check_if_version_upgraded.outputs.remote_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 ${{ needs.check_if_version_upgraded.outputs.version }} | |
tag_name: ${{ 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 }} |