ci: update to support beta-metrics.lecoq.io
This commit is contained in:
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
@@ -119,6 +119,19 @@ jobs:
|
|||||||
docker tag ghcr.io/lowlighter/metrics:master ghcr.io/lowlighter/metrics:main
|
docker tag ghcr.io/lowlighter/metrics:master ghcr.io/lowlighter/metrics:main
|
||||||
docker push ghcr.io/lowlighter/metrics:main
|
docker push ghcr.io/lowlighter/metrics:main
|
||||||
|
|
||||||
|
# Deploy to beta-metrics.lecoq.io
|
||||||
|
deploy-master:
|
||||||
|
name: Deploy lowlighter/metrics@master
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [ docker-master ]
|
||||||
|
steps:
|
||||||
|
- name: Deploy web instance
|
||||||
|
run: "curl -X POST -H 'Authorization: ${{ secrets.WEB_DEPLOY_BETA_TOKEN }}' https://beta-metrics.lecoq.io/.control/stop"
|
||||||
|
- name: Wait for redeploy
|
||||||
|
run: sleep 120
|
||||||
|
- name: Check deployment status
|
||||||
|
run: "curl --retry 15 --retry-delay 60 https://beta-metrics.lecoq.io/.version"
|
||||||
|
|
||||||
# Test lowlighter/metrics@master
|
# Test lowlighter/metrics@master
|
||||||
action-master-test:
|
action-master-test:
|
||||||
name: Test lowlighter/metrics@master
|
name: Test lowlighter/metrics@master
|
||||||
@@ -137,7 +150,7 @@ jobs:
|
|||||||
# Publish examples
|
# Publish examples
|
||||||
publish-examples:
|
publish-examples:
|
||||||
name: Publish examples
|
name: Publish examples
|
||||||
needs: [ docker-master ]
|
needs: [ action-master-test ]
|
||||||
uses: lowlighter/metrics/.github/workflows/examples.yml@master
|
uses: lowlighter/metrics/.github/workflows/examples.yml@master
|
||||||
secrets:
|
secrets:
|
||||||
METRICS_TOKEN: ${{ secrets.METRICS_TOKEN }}
|
METRICS_TOKEN: ${{ secrets.METRICS_TOKEN }}
|
||||||
@@ -152,14 +165,14 @@ jobs:
|
|||||||
# Publish examples (presets)
|
# Publish examples (presets)
|
||||||
publish-examples-presets:
|
publish-examples-presets:
|
||||||
name: Publish examples (presets)
|
name: Publish examples (presets)
|
||||||
needs: [ docker-master ]
|
needs: [ action-master-test ]
|
||||||
uses: lowlighter/metrics/.github/workflows/examples.presets.yml@master
|
uses: lowlighter/metrics/.github/workflows/examples.presets.yml@master
|
||||||
|
|
||||||
# Build docker image from master and publish it to GitHub registry with release tag
|
# Build docker image from master and publish it to GitHub registry with release tag
|
||||||
docker-release:
|
docker-release:
|
||||||
name: Publish release to GitHub registry
|
name: Publish release to GitHub registry
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ action-master-test, publish-examples ]
|
needs: [ publish-examples ]
|
||||||
if: contains(github.event.head_commit.message, '[release]')
|
if: contains(github.event.head_commit.message, '[release]')
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -181,7 +194,7 @@ jobs:
|
|||||||
update-latest:
|
update-latest:
|
||||||
name: Rebase latest on master
|
name: Rebase latest on master
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ docker-release, publish-examples ]
|
needs: [ docker-release ]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -221,10 +234,14 @@ jobs:
|
|||||||
deploy-latest:
|
deploy-latest:
|
||||||
name: Deploy lowlighter/metrics@latest
|
name: Deploy lowlighter/metrics@latest
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: [ update-latest ]
|
needs: [ docker-release, deploy-master ]
|
||||||
steps:
|
steps:
|
||||||
- name: Deploy web instance
|
- name: Deploy web instance
|
||||||
run: "curl -X POST -H 'Authorization: ${{ secrets.WEB_DEPLOY_TOKEN }}' https://metrics.lecoq.io/.control/stop"
|
run: "curl -X POST -H 'Authorization: ${{ secrets.WEB_DEPLOY_TOKEN }}' https://metrics.lecoq.io/.control/stop"
|
||||||
|
- name: Wait for redeploy
|
||||||
|
run: sleep 120
|
||||||
|
- name: Check deployment status
|
||||||
|
run: "curl --retry 15 --retry-delay 60 https://metrics.lecoq.io/.version"
|
||||||
|
|
||||||
# Publish GitHub release
|
# Publish GitHub release
|
||||||
publish-release:
|
publish-release:
|
||||||
|
|||||||
Reference in New Issue
Block a user