Skip to content

Commit

Permalink
Adding workflow for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
placccebo committed Jul 25, 2024
1 parent f29f7f6 commit 130dbab
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 2 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: main

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

on:
push:
tags: [ 'v*.*.*' ]
branches: [ 'main' ]

env:
REGISTRY: ghcr.io

jobs:
docker:
runs-on:
- self-hosted
- ${{ matrix.runner }}
permissions:
contents: read
packages: write
id-token: write
strategy:
matrix:
include:
- docker_file: Dockerfile
name: pipeline-watchdog-arm64
arch: linux/arm64
tag: ghcr.io/insight-platform/pipeline-watchdog-arm64
runner: ARM64
- docker_file: Dockerfile
name: pipeline-watchdog-x86
arch: linux/amd64
tag: ghcr.io/insight-platform/pipeline-watchdog-x86
runner: X64

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Inject slug/short variables
uses: rlespinasse/[email protected]

# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/[email protected]

# https://github.com/docker/build-push-action
- name: Build docker image for ${{ env.GITHUB_REF_SLUG }}
uses: docker/[email protected]
with:
file: ${{ matrix.docker_file }}
platforms: ${{ matrix.arch }}
tags: "${{matrix.tag}}:${{ env.GITHUB_REF_SLUG }}"
load: true
context: .
cache-from: type=gha
cache-to: type=gha,mode=max

# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ github.token }}

# https://github.com/docker/build-push-action
- name: Push docker image for ${{ env.GITHUB_REF_SLUG }}
uses: docker/[email protected]
with:
file: ${{ matrix.docker_file }}
platforms: ${{ matrix.arch }}
tags: "${{matrix.tag}}:${{ env.GITHUB_REF_SLUG }}"
push: true
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
File renamed without changes.
4 changes: 2 additions & 2 deletions samples/pipeline_monitoring/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ services:
pipeline-watchdog:
container_name: pipeline-watchdog
build:
context: ../..
dockerfile: ./samples/pipeline_monitoring/Dockerfile
context: ../../
dockerfile: Dockerfile
restart: unless-stopped
network_mode: host
volumes:
Expand Down

0 comments on commit 130dbab

Please sign in to comment.