-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This includes adding the '--skip-image-build' option to the build script. Signed-off-by: David Caro <[email protected]>
- Loading branch information
1 parent
a95989b
commit 4edae54
Showing
2 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Build and Publish Image | ||
on: | ||
push: {} | ||
repository_dispatch: | ||
types: [fe-change, be-change] | ||
|
||
jobs: | ||
build: | ||
name: Build and publish image | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: farting-lizards/expenses_server_fastapi | ||
path: expenses_server_fastapi | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
repository: farting-lizards/expenses-react | ||
path: expenses-react | ||
|
||
# this the last so we end up inside the cloned directory | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: expenses-container | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 16 | ||
|
||
- name: Build code | ||
id: build-code | ||
env: | ||
DISABLE_ESLINT_PLUGIN: "true" | ||
run: | | ||
cd expenses-container \ | ||
&& bash -x ./build.sh --skip-image-build ../expenses-react ../expenses_server_fastapi | ||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')" | ||
|
||
# for arm image building | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Update buildah (we neew >=1.24) | ||
run: | | ||
sudo apt-get -y update \ | ||
&& sudo apt-get -y install --upgrade buildah | ||
- name: Build Image | ||
id: build-image | ||
uses: redhat-actions/buildah-build@v2 | ||
with: | ||
image: expenses | ||
context: expenses-container | ||
platforms: linux/arm64/v8 | ||
tags: latest ${{ github.sha }} ${{ steps.date.outputs.date }} | ||
containerfiles: | | ||
./expenses-container/Dockerfile.prod | ||
- name: Push To quay.io | ||
id: push-to-quay | ||
uses: redhat-actions/push-to-registry@v2 | ||
with: | ||
image: ${{ steps.build-image.outputs.image }} | ||
tags: ${{ steps.build-image.outputs.tags }} | ||
registry: quay.io/farting_lizards | ||
username: ${{ secrets.QUAY_USER }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: Print image url | ||
run: | | ||
echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}" |
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