Bump github.com/xBlaz3kx/DevX from 0.1.0 to 0.2.3 #86
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 and Push" | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- './.github/workflows/lint.yaml' | |
- './.github/workflows/test.yaml' | |
- './.github/dependabot.yaml' | |
- 'docs/**' | |
- 'documentation/**' | |
- '*.md' | |
- 'docker-compose.yaml' | |
- 'docker-compose.dev.yaml' | |
tags: | |
- 'v*' | |
pull_request: | |
types: [ opened, synchronize ] | |
branches: | |
- main | |
jobs: | |
build-and-push-manager: | |
name: "Build and Push the Manager" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v4 | |
with: | |
path: go-build-cache | |
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} | |
- name: Inject go-build-cache into docker | |
# v1 was composed of two actions: "inject" and "extract". | |
# v2 is unified to a single action. | |
uses: reproducible-containers/buildkit-cache-dance@v3.1.2 | |
with: | |
cache-source: go-build-cache | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
xblaz3kx/distributed-scheduler | |
flavor: | | |
prefix=manager- | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
# Build and push Docker image with Buildx (don't push on PR) | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v6 | |
with: | |
file: ./build/manager/Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} # Don't push on PR | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
build-and-push-runner: | |
name: "Build and Push the Runner" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v4 | |
with: | |
path: go-build-cache | |
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }} | |
- name: Inject go-build-cache into docker | |
# v1 was composed of two actions: "inject" and "extract". | |
# v2 is unified to a single action. | |
uses: reproducible-containers/buildkit-cache-dance@v3.1.2 | |
with: | |
cache-source: go-build-cache | |
# Extract metadata (tags, labels) for Docker | |
# https://github.com/docker/metadata-action | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
xblaz3kx/distributed-scheduler | |
flavor: | | |
prefix=runner- | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
# Build and push Docker image with Buildx (don't push on PR) | |
# https://github.com/docker/build-push-action | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@v6 | |
with: | |
file: ./build/runner/Dockerfile | |
push: ${{ github.event_name != 'pull_request' }} # Don't push on PR | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |