Skip to content

Commit

Permalink
More workflows (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndWeHaveAPlan authored Nov 4, 2024
1 parent ba703a0 commit 6acfd6d
Show file tree
Hide file tree
Showing 38 changed files with 795 additions and 20 deletions.
12 changes: 8 additions & 4 deletions .github/actions/build-push-image-selfhosted/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ inputs:
required: false
default: ""

context:
required: false
default: "./"

push:
required: false
default: true
Expand All @@ -38,14 +42,14 @@ runs:
- name: docker build
uses: docker/build-push-action@v6
with:
context: ./
context: ${{ inputs.context }}
file: ./${{ inputs.image-name }}/Dockerfile
tags: ${{ inputs.image-tags }}
push: true
build-args: |
VCS_REF="${{ github.sha }}"
BUILD_DATE="${{ steps.vars.outputs.BUILD_DATE }}"
REGISTRY_PATH="${{ inputs.registry }}"
VCS_REF=${{ github.sha }}
BUILD_DATE=${{ steps.vars.outputs.BUILD_DATE }}
REGISTRY_PATH=${{ inputs.registry }}
${{ inputs.build-args }}
- name: Print image url
Expand Down
12 changes: 8 additions & 4 deletions .github/actions/build-push-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ inputs:
registry-password:
required: false

context:
required: false
default: "./"

image-name:
required: true
image-tags:
Expand Down Expand Up @@ -38,13 +42,13 @@ runs:
with:
image: ${{ inputs.registry }}/${{ inputs.image-name }}
tags: ${{ inputs.image-tags }}
context: ./
context: ${{ inputs.context }}
containerfiles: |
./${{ inputs.image-name }}/Dockerfile
build-args: |
VCS_REF="${{ github.sha }}"
BUILD_DATE="${{ steps.vars.outputs.BUILD_DATE }}"
REGISTRY_PATH="${{ inputs.registry }}"
VCS_REF=${{ github.sha }}
BUILD_DATE=${{ steps.vars.outputs.BUILD_DATE }}
REGISTRY_PATH=${{ inputs.registry }}
${{ inputs.build-args }}
extra-args: |
--format=docker
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/awscli.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: awscli

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'awscli/*'
- '.github/workflows/awscli.yml'
workflow_dispatch:

env:
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: 'awscli'

jobs:
Build:
runs-on: ubuntu-latest
environment: ${{ github.event_name == 'workflow_dispatch' && 'main' || null }}
steps:

- uses: actions/checkout@v4

- name: set vars
id: vars
run: |
export COMMIT_SHA=${{ github.sha }}
echo "IMAGE_DATE_TAG=${COMMIT_SHA:0:8}-$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: build and push staging
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH_PR }}
registry-user: ${{ secrets.REGISTRY_USER }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
staging
- name: build and push
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH }}
registry-user: ${{ secrets.REGISTRY_USER }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
${{ steps.vars.outputs.IMAGE_DATE_TAG }}
latest
51 changes: 51 additions & 0 deletions .github/workflows/base-bin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: base-bin

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'base-bin/*'
- '.github/workflows/base-bin.yml'
workflow_dispatch:

env:
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: 'base-bin'

jobs:
Build:
runs-on: ubuntu-latest
environment: ${{ github.event_name == 'workflow_dispatch' && 'main' || null }}
steps:

- uses: actions/checkout@v4

- name: set vars
id: vars
run: |
export COMMIT_SHA=${{ github.sha }}
echo "IMAGE_DATE_TAG=${COMMIT_SHA:0:8}-$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: build and push staging
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH_PR }}
registry-user: ${{ secrets.REGISTRY_USER }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
staging
- name: build and push
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH }}
registry-user: ${{ secrets.REGISTRY_USER }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
${{ steps.vars.outputs.IMAGE_DATE_TAG }}
latest
4 changes: 2 additions & 2 deletions .github/workflows/ci-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
workflow_dispatch:

env:
REGISTRY_PATH: "docker.io/paritytech"
REGISTRY_PATH_PR: "docker.io/paritypr"
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: "ci-unified"
RUST_STABLE_VERSION: "1.81.0"
RUST_NIGHTLY_VERSION: "2024-09-11"
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/deb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: deb

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'deb/*'
- '.github/workflows/deb.yml'
workflow_dispatch:

env:
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: 'deb'

jobs:
Build:
runs-on: ubuntu-latest
environment: ${{ github.event_name == 'workflow_dispatch' && 'main' || null }}
steps:

- uses: actions/checkout@v4

- name: set vars
id: vars
run: |
export COMMIT_SHA=${{ github.sha }}
echo "IMAGE_DATE_TAG=${COMMIT_SHA:0:8}-$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: build and push staging
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH_PR }}
registry-user: ${{ secrets.REGISTRY_USER }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
staging
- name: build and push
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH }}
registry-user: ${{ secrets.REGISTRY_USER }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
${{ steps.vars.outputs.IMAGE_DATE_TAG }}
latest
2 changes: 1 addition & 1 deletion .github/workflows/debian11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: "docker.io/paritypr"
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: 'debian11'

jobs:
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/gnupg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: gnupg

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'gnupg/*'
- '.github/workflows/gnupg.yml'
workflow_dispatch:

env:
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: 'gnupg'

jobs:
Build:
runs-on: ubuntu-latest
environment: ${{ github.event_name == 'workflow_dispatch' && 'main' || null }}
steps:

- uses: actions/checkout@v4

- name: set vars
id: vars
run: |
export COMMIT_SHA=${{ github.sha }}
echo "IMAGE_DATE_TAG=${COMMIT_SHA:0:8}-$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: build and push staging
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH_PR }}
registry-user: ${{ secrets.REGISTRY_USER }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
staging
latest
- name: build and push
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH }}
registry-user: ${{ secrets.REGISTRY_USER }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
${{ steps.vars.outputs.IMAGE_DATE_TAG }}
latest
2 changes: 1 addition & 1 deletion .github/workflows/kubetools-kubectl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: "docker.io/paritypr"
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: 'kubetools-kubectl'
KUBE_VERSION: '1.26.6'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mitogen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: "docker.io/paritypr"
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: 'mitogen'

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: "docker.io/paritypr"
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: 'packer'
PACKER_VERSION: "1.8.7"
VAULT_VERSION: "1.17.3"
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/parity-keyring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: parity-keyring

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'parity-keyring/*'
- '.github/workflows/parity-keyring.yml'
workflow_dispatch:

env:
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: 'parity-keyring'

jobs:
Build:
runs-on: ubuntu-latest
environment: ${{ github.event_name == 'workflow_dispatch' && 'main' || null }}
steps:

- uses: actions/checkout@v4

- name: set vars
id: vars
run: |
export COMMIT_SHA=${{ github.sha }}
echo "IMAGE_DATE_TAG=${COMMIT_SHA:0:8}-$(date +%Y%m%d)" >> $GITHUB_OUTPUT
- name: build and push staging
if: ${{ github.event_name == 'pull_request' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH_PR }}
registry-user: ${{ secrets.REGISTRY_USER }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
staging
- name: build and push
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: ./.github/actions/build-push-image
with:
registry: ${{ env.REGISTRY_PATH }}
registry-user: ${{ secrets.REGISTRY_USER }}
registry-password: ${{ secrets.REGISTRY_PASSWORD }}
image-name: ${{ env.IMAGE_NAME }}
image-tags: >
${{ steps.vars.outputs.IMAGE_DATE_TAG }}
latest
2 changes: 1 addition & 1 deletion .github/workflows/polkadotjs-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: "docker.io/paritypr"
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: 'polkadotjs-cli'

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
REGISTRY_PATH: 'docker.io/paritytech'
REGISTRY_PATH_PR: "docker.io/paritypr"
REGISTRY_PATH_PR: 'docker.io/paritypr'
IMAGE_NAME: 'python'
PYTHON_VERSION: "3.12"
VAULT_VERSION: "1.17.3"
Expand Down
Loading

0 comments on commit 6acfd6d

Please sign in to comment.