Skip to content

Commit

Permalink
change actions
Browse files Browse the repository at this point in the history
  • Loading branch information
falmar committed Apr 29, 2023
1 parent 2282672 commit f3848f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: build

on:
push:
workflow_call:
pull_request:
branches:
- master
- dev
Expand Down Expand Up @@ -34,12 +36,3 @@ jobs:
CGO_ENABLED: "0"
GOOS: linux
GOARCH: ${{ matrix.platform }}

push:
if: ${{ success() }}
needs: build
uses: ./.github/workflows/push.yaml
with:
image_tag: "latest"
secrets:
HUB_PASSWORD: ${{ secrets.HUB_PASSWORD }}
19 changes: 8 additions & 11 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
name: push_image

on:
workflow_call:
inputs:
image_tag:
type: string
description: 'The tag of the image to push'
required: true
default: 'latest'
secrets:
HUB_PASSWORD:
required: true
push:
branches:
- master

env:
REGISTRY: docker.io
Expand All @@ -19,8 +12,12 @@ env:
DOCKER_IMAGE_TAG: ${{ inputs.image_tag }}

jobs:
build:
uses: ./.github/workflows/build.yaml

image:
if: github.ref == 'refs/heads/master'
if: ${{ success() }}
needs: build
env:
platform: linux/amd64,linux/arm64
runs-on: ubuntu-latest
Expand Down

0 comments on commit f3848f4

Please sign in to comment.