Skip to content

Commit

Permalink
Update docker registry and deploy process (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
floodcode committed Aug 2, 2024
2 parents 3d62d43 + e110135 commit 21126b4
Show file tree
Hide file tree
Showing 17 changed files with 235 additions and 450 deletions.
1 change: 1 addition & 0 deletions .github/actions/build-and-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ runs:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ inputs.docker-username }}
password: ${{ inputs.docker-password }}

Expand Down
1 change: 1 addition & 0 deletions .github/actions/multiarch-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ runs:
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ inputs.docker-username }}
password: ${{ inputs.docker-password }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
- name: Build and push
uses: ./.github/actions/build-and-push
with:
docker-username: ${{ secrets.DOCKER_USERNAME }}
docker-password: ${{ secrets.DOCKER_PASSWORD }}
docker-base-repo: ${{ secrets.DOCKER_BASE_REPO_DEV }}-${{ matrix.platform.image-suffix }}
docker-username: ${{ secrets.CR_USERNAME }}
docker-password: ${{ secrets.CR_PAT }}
docker-base-repo: ghcr.io/ator-development/ator-protocol-dev-${{ matrix.platform.image-suffix }}
docker-tag: latest-pr
docker-platform: ${{ matrix.platform.name }}
version: ${{ github.sha }}
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/dev-build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Dev Build Image and Deploy

on:
push:
branches:
- development
workflow_dispatch:

env:
image-name: ghcr.io/ator-development/ator-protocol-dev
image-tag: ${{ github.sha }}
da-1-hc-url: http://49.13.145.234:9030/tor/status-vote/current/consensus
da-2-hc-url: http://5.161.108.187:9030/tor/status-vote/current/consensus
da-3-hc-url: http://5.78.90.106:9030/tor/status-vote/current/consensus

jobs:
build-and-push:
runs-on: ${{ matrix.platform.runs-on }}
strategy:
matrix:
platform:
- name: linux/amd64
image-suffix: amd64
runs-on: ubuntu-latest
- name: linux/arm64
image-suffix: arm64
runs-on: arm64
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Build and push
uses: ./.github/actions/build-and-push
with:
docker-username: ${{ secrets.CR_USERNAME }}
docker-password: ${{ secrets.CR_PAT }}
docker-base-repo: ${{ env.image-name }}-${{ matrix.platform.image-suffix }}
docker-tag: ${{ env.image-tag }}
docker-platform: ${{ matrix.platform.name }}
version: ${{ github.sha }}
environment: dev
event-name: ${{ github.event_name }}

multiarch-push:
runs-on: ubuntu-latest
needs: build-and-push
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Multiarch push
uses: ./.github/actions/multiarch-push
with:
docker-username: ${{ secrets.CR_USERNAME }}
docker-password: ${{ secrets.CR_PAT }}
docker-base-repo: ${{ env.image-name }}
docker-tag: ${{ env.image-tag }}
event-name: ${{ github.event_name }}

deploy:
needs: multiarch-push
runs-on: ubuntu-latest
steps:
- name: Deploy new version
uses: ./.github/actions/deploy
with:
image-tag: ${{ env.image-tag }}
nomad-job-file: anon-da-node-dev.hcl
health-checks: "${{ env.da-1-hc-url }}|${{ env.da-2-hc-url }}|${{ env.da-3-hc-url }}"
nomad-cacert: operations/admin-ui-ca.crt
nomad-token: ${{ secrets.NOMAD_TOKEN_ATOR_NETWORK_DEPLOY }}
nomad-addr: ${{ secrets.NOMAD_DEPLOY_ADDR }}
consul-cacert: operations/admin-ui-ca.crt
consul-http-token: ${{ secrets.CONSUL_HTTP_TOKEN_ATOR_NETWORK_DEPLOY }}
consul-addr: ${{ secrets.CONSUL_DEPLOY_ADDR }}
61 changes: 0 additions & 61 deletions .github/workflows/dev-build-and-push.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/dev-deploy.yml

This file was deleted.

73 changes: 73 additions & 0 deletions .github/workflows/live-build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Live Build Image and Deploy

on:
push:
tags:
- 'v*.*.*.*'
workflow_dispatch:

env:
image-name: ghcr.io/ator-development/ator-protocol
image-tag: ${{ github.ref_name }}
da-1-hc-url: http://49.13.145.234:9230/tor/status-vote/current/consensus
da-2-hc-url: http://5.161.108.187:9230/tor/status-vote/current/consensus
da-3-hc-url: http://5.78.90.106:9230/tor/status-vote/current/consensus

jobs:
build-and-push:
runs-on: ${{ matrix.platform.runs-on }}
strategy:
matrix:
platform:
- name: linux/amd64
image-suffix: amd64
runs-on: ubuntu-latest
- name: linux/arm64
image-suffix: arm64
runs-on: arm64
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Build and push
uses: ./.github/actions/build-and-push
with:
docker-username: ${{ secrets.CR_USERNAME }}
docker-password: ${{ secrets.CR_PAT }}
docker-base-repo: ${{ env.image-name }}-${{ matrix.platform.image-suffix }}
docker-tag: ${{ env.image-tag }}
docker-platform: ${{ matrix.platform.name }}
version: ${{ github.sha }}
environment: live
event-name: ${{ github.event_name }}

multiarch-push:
runs-on: ubuntu-latest
needs: build-and-push
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Multiarch push
uses: ./.github/actions/multiarch-push
with:
docker-username: ${{ secrets.CR_USERNAME }}
docker-password: ${{ secrets.CR_PAT }}
docker-base-repo: ${{ env.image-name }}
docker-tag: ${{ env.image-tag }}
event-name: ${{ github.event_name }}

deploy:
needs: multiarch-push
runs-on: ubuntu-latest
steps:
- name: Deploy new version
uses: ./.github/actions/deploy
with:
image-tag: ${{ env.image-tag }}
nomad-job-file: anon-da-node-live.hcl
health-checks: "${{ env.da-1-hc-url }}|${{ env.da-2-hc-url }}|${{ env.da-3-hc-url }}"
nomad-cacert: operations/admin-ui-ca.crt
nomad-token: ${{ secrets.NOMAD_TOKEN_ATOR_NETWORK_DEPLOY }}
nomad-addr: ${{ secrets.NOMAD_DEPLOY_ADDR }}
consul-cacert: operations/admin-ui-ca.crt
consul-http-token: ${{ secrets.CONSUL_HTTP_TOKEN_ATOR_NETWORK_DEPLOY }}
consul-addr: ${{ secrets.CONSUL_DEPLOY_ADDR }}
62 changes: 0 additions & 62 deletions .github/workflows/live-build-and-push.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/live-deploy.yml

This file was deleted.

Loading

0 comments on commit 21126b4

Please sign in to comment.