Skip to content

Commit

Permalink
feat(github): workflow for upload on s3 (base)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikr4-m committed Aug 15, 2024
1 parent a99e5d6 commit ebf5b22
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 2 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- development

jobs:
client:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/build-upload-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Upload file to S3

on:
push:
branches:
- master
- development

jobs:
client:
uses: ./.github/workflows/reusable-build-golang-alpine.yml
with:
make_command: build-client
use_artifacts: true
binary_name: mdrop
secrets: inherit

client-upload:
needs: client
uses: ./.github/workflows/reusable-upload-s3.yml
with:
binary_name: mdrop
secrets: inherit

tunnel:
uses: ./.github/workflows/reusable-build-golang-alpine.yml
with:
make_command: build-tunnel
use_artifacts: true
binary_name: mdrop-tunnel
secrets: inherit

tunnel-upload:
needs: tunnel
uses: ./.github/workflows/reusable-upload-s3.yml
with:
binary_name: mdrop-tunnel
secrets: inherit
1 change: 0 additions & 1 deletion .github/workflows/push-image-broker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- master
- development

jobs:
build-sshd:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/reusable-build-golang-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on:
make_command:
type: string
default: restore
use_artifacts:
type: boolean
default: false
binary_name:
type: string
default: mdrop

jobs:
build:
Expand All @@ -23,3 +29,9 @@ jobs:
apk add make gcc musl-dev
- name: Build app
run: make ${{ inputs.make_command }}
- name: Upload artifacts
if: ${{ inputs.use_artifacts }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.binary_name }}-build-artifact
path: ${{ inputs.binary_name }}
28 changes: 28 additions & 0 deletions .github/workflows/reusable-upload-s3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Reusable workflow for upload file to S3

on:
workflow_call:
secrets:
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
inputs:
binary_name:
type: string
default: mdrop

jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Download artifacts
if: ${{ inputs.use_artifacts }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.binary_name }}-build-artifact
path: ${{ inputs.binary_name }}
- name: Check file
run: |
ls -lah
pwd

0 comments on commit ebf5b22

Please sign in to comment.