[LUM-851] Hotfix Campaign module (#143) #79
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: Build & deploy the chain bridge to the cloud services | |
on: | |
push: | |
branches: | |
- master | |
env: | |
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} | |
REGISTRY_ADDRESS: rg.fr-par.scw.cloud/lum-network | |
REGISTRY_ADDRESS_PROJECT: bridge | |
jobs: | |
bump-version-push-tag: | |
name: Bump version and push new tag | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
with: | |
fetch-depth: '0' | |
- name: Bump version and push new tag | |
id: bump_version | |
uses: anothrNick/github-tag-action@1.36.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
WITH_V: true | |
- name: Print generated version | |
shell: bash | |
run: | | |
echo "${{ steps.bump_version.outputs.tag }}" | |
- name: Save new version number result into file | |
shell: bash | |
run: | | |
echo ${{ steps.bump_version.outputs.tag }} > new_version.txt | |
- name: Upload version number for further use | |
uses: actions/upload-artifact@v1 | |
with: | |
name: new_version | |
path: new_version.txt | |
build: | |
name: Build the docker image and deploy over image registry | |
runs-on: ubuntu-latest | |
needs: bump-version-push-tag | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Download version number from bump-version-push-tag | |
uses: actions/download-artifact@v1 | |
with: | |
name: new_version | |
- name: Create version number variable | |
id: vars | |
run: echo ::set-output name=version_tag_number::$(cat new_version/new_version.txt) | |
- name: Print generated version | |
shell: bash | |
run: | | |
echo "${{ steps.vars.outputs.version_tag_number }}" | |
- name: Build, tag and push the built image | |
run: | | |
docker login $REGISTRY_ADDRESS -u nologin -p $REGISTRY_TOKEN | |
docker build -t $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-api:latest -t $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-api:"${{ steps.vars.outputs.version_tag_number }}" -f tools/API.Dockerfile . | |
docker build -t $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-sync-consumer:latest -t $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-sync-consumer:"${{ steps.vars.outputs.version_tag_number }}" -f tools/SyncConsumer.Dockerfile . | |
docker build -t $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-sync-scheduler:latest -t $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-sync-scheduler:"${{ steps.vars.outputs.version_tag_number }}" -f tools/SyncScheduler.Dockerfile . | |
docker push $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-api:${{ steps.vars.outputs.version_tag_number }} | |
docker push $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-api:latest | |
docker push $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-sync-consumer:${{ steps.vars.outputs.version_tag_number }} | |
docker push $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-sync-consumer:latest | |
docker push $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-sync-scheduler:${{ steps.vars.outputs.version_tag_number }} | |
docker push $REGISTRY_ADDRESS/$REGISTRY_ADDRESS_PROJECT-sync-scheduler:latest | |
deploy_testnet: | |
name: Upgrade the testnet CapRover services | |
runs-on: ubuntu-latest | |
needs: build | |
environment: testnet | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Download version number from bump-version-push-tag | |
uses: actions/download-artifact@v1 | |
with: | |
name: new_version | |
- name: Create version number variable | |
id: vars | |
run: echo ::set-output name=version_tag_number::$(cat new_version/new_version.txt) | |
- name: Update API service | |
uses: floms/action-caprover@v1 | |
with: | |
host: '${{ secrets.CAPROVER_HOST }}' | |
password: '${{ secrets.CAPROVER_PASSWORD }}' | |
app: 'explorer-testnet' | |
image: ${{env.REGISTRY_ADDRESS}}/${{env.REGISTRY_ADDRESS_PROJECT}}-api:${{ steps.vars.outputs.version_tag_number }} | |
- name: Update Sync Consumer service | |
uses: floms/action-caprover@v1 | |
with: | |
host: '${{ secrets.CAPROVER_HOST }}' | |
password: '${{ secrets.CAPROVER_PASSWORD }}' | |
app: 'explorer-testnet-sync-consumer' | |
image: ${{env.REGISTRY_ADDRESS}}/${{env.REGISTRY_ADDRESS_PROJECT}}-sync-consumer:${{ steps.vars.outputs.version_tag_number }} | |
- name: Update Sync Scheduler service | |
uses: floms/action-caprover@v1 | |
with: | |
host: '${{ secrets.CAPROVER_HOST }}' | |
password: '${{ secrets.CAPROVER_PASSWORD }}' | |
app: 'explorer-testnet-sync-scheduler' | |
image: ${{env.REGISTRY_ADDRESS}}/${{env.REGISTRY_ADDRESS_PROJECT}}-sync-scheduler:${{ steps.vars.outputs.version_tag_number }} | |
deploy_mainnet: | |
name: Upgrade the mainnet CapRover services | |
runs-on: ubuntu-latest | |
needs: build | |
environment: mainnet | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Download version number from bump-version-push-tag | |
uses: actions/download-artifact@v1 | |
with: | |
name: new_version | |
- name: Create version number variable | |
id: vars | |
run: echo ::set-output name=version_tag_number::$(cat new_version/new_version.txt) | |
- name: Update API service | |
uses: floms/action-caprover@v1 | |
with: | |
host: '${{ secrets.CAPROVER_HOST }}' | |
password: '${{ secrets.CAPROVER_PASSWORD }}' | |
app: 'explorer-mainnet' | |
image: ${{env.REGISTRY_ADDRESS}}/${{env.REGISTRY_ADDRESS_PROJECT}}-api:${{ steps.vars.outputs.version_tag_number }} | |
- name: Update Sync Consumer service | |
uses: floms/action-caprover@v1 | |
with: | |
host: '${{ secrets.CAPROVER_HOST }}' | |
password: '${{ secrets.CAPROVER_PASSWORD }}' | |
app: 'explorer-mainnet-sync-consumer' | |
image: ${{env.REGISTRY_ADDRESS}}/${{env.REGISTRY_ADDRESS_PROJECT}}-sync-consumer:${{ steps.vars.outputs.version_tag_number }} | |
- name: Update Sync Scheduler service | |
uses: floms/action-caprover@v1 | |
with: | |
host: '${{ secrets.CAPROVER_HOST }}' | |
password: '${{ secrets.CAPROVER_PASSWORD }}' | |
app: 'explorer-mainnet-sync-scheduler' | |
image: ${{env.REGISTRY_ADDRESS}}/${{env.REGISTRY_ADDRESS_PROJECT}}-sync-scheduler:${{ steps.vars.outputs.version_tag_number }} |