Skip to content

Commit

Permalink
refinement github actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur1 committed Jul 12, 2024
1 parent 79e3a71 commit 1c1605b
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/on-push-version-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: On push version tag
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
build-push:
uses: ./.github/workflows/wf-build.yml
with:
needs-push: true
8 changes: 8 additions & 0 deletions .github/workflows/on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: On push
on:
push:
tags-ignore:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
uses: ./.github/workflows/wf-build.yml
36 changes: 36 additions & 0 deletions .github/workflows/wf-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build
on:
workflow_call:
inputs:
needs-push:
type: boolean
default: false
jobs:
build:
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: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get tag
id: get_tag
run: echo "::set-output name=tag::${GITHUB_REF##*/}"
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: |
linux/amd64
linux/arm64
push: true
tags: |
mackerel/mackerel-agent:latest
mackerel/mackerel-agent:${{ steps.get_tag.outputs.tag }}

0 comments on commit 1c1605b

Please sign in to comment.