Skip to content

Commit

Permalink
cicd: added docker build action
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivica Matic committed Oct 25, 2023
1 parent fc0a7b3 commit 1b7f08f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build_and_push_docker_image_staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and push Docker image for staging environment

permissions:
contents: read
on:
workflow_dispatch:
push:
branches:
- staging

jobs:
docker-build-push-dev:
runs-on: ubuntu-latest
environment: STAGING_ENVIRONMENT
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set Short SHA
run: echo "SHORT_SHA=$(git rev-parse --short=7 $GITHUB_SHA)" >> $GITHUB_ENV
- name: echo Short SHA
run: echo $SHORT_SHA
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.EO_PROJ_STAGING_DOCKER_REGISTRY_URL}}
username: ${{ secrets.EO_PROJ_STAGING_DOCKER_USERNAME }}
password: ${{ secrets.EO_PROJ_STAGING_DOCKER_PASSWORD }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image under tag ${{ env.SHORT_SHA }}
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
cache-from: type=registry,ref=${{ secrets.EO_PROJ_STAGING_DOCKER_REGISTRY_URL }}/stac-landing:cache
cache-to: type=registry,ref=${{ secrets.EO_PROJ_STAGING_DOCKER_REGISTRY_URL }}/stac-landing:cache,mode=max
push: true
tags: ${{ secrets.EO_PROJ_STAGING_DOCKER_REGISTRY_URL }}/stac-landing:${{ env.SHORT_SHA }}
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: Build React website and upload to Azure Storage Blob
on:
workflow_dispatch:
push:
branches:
- staging

jobs:
build:
runs-on: ubuntu-latest
environment: STAGING_ENVIRONMENT
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down

0 comments on commit 1b7f08f

Please sign in to comment.