Skip to content

Commit

Permalink
Add github actions build process
Browse files Browse the repository at this point in the history
  • Loading branch information
alinz committed May 15, 2024
1 parent 987067a commit 2e63008
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/credentials/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Baker
on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Extract tag version
id: tag_version
run: echo "VALUE=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Extract git commit hash
id: git_commit
run: echo "VALUE=$(git rev-list -1 HEAD)" >> $GITHUB_OUTPUT

- name: Prepare the credentials
run: |
echo "ELLA_ACCESS_TOKEN=${{ secrets.ELLA_ACCESS_TOKEN }}" > .github/credentials/.env
- name: build
env:
VERSION: ${{ steps.tag_version.outputs.VALUE }}
GIT_COMMIT: ${{ steps.git_commit.outputs.VALUE }}
run: |
docker build \
--build-arg GIT_COMMIT=${{ env.GIT_COMMIT }} \
--build-arg VERSION=${{ env.VERSION }} \
--no-cache \
--progress=plain \
--secret id=_env,src=.github/credentials/.env \
-t ellato/baker:${{ env.VERSION }} -t ellato/baker:latest .
echo ${{ secrets.ELLA_DOCKER_TOKEN }} | docker login -u ellato --password-stdin
docker push ellato/baker:${{ env.VERSION }}
docker push ellato/baker:latest

0 comments on commit 2e63008

Please sign in to comment.